delay_network_call.h revision effb81e5f8246d0db0270817048dc992db66e9fb
1// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// This file contains utility functions to wait for network state.
6
7#ifndef CHROME_BROWSER_CHROMEOS_NET_DELAY_NETWORK_CALL_H_
8#define CHROME_BROWSER_CHROMEOS_NET_DELAY_NETWORK_CALL_H_
9
10namespace base {
11
12template <typename T>
13class Callback;
14
15typedef Callback<void(void)> Closure;
16
17class TimeDelta;
18
19}  // namespace base
20
21namespace chromeos {
22
23// Default delay to be used as an argument to DelayNetworkCall().
24extern const unsigned kDefaultNetworkRetryDelayMS;
25
26// Delay callback until the network is connected or while on a captive portal.
27void DelayNetworkCall(const base::Closure& callback, base::TimeDelta retry);
28
29}  // namespace chromeos
30
31#endif  // CHROME_BROWSER_CHROMEOS_NET_DELAY_NETWORK_CALL_H_
32