OLD | NEW |
| (Empty) |
1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_BASE_ASYNC_NETWORK_ALIVE_H_ | |
6 #define CHROME_BROWSER_SYNC_NOTIFIER_BASE_ASYNC_NETWORK_ALIVE_H_ | |
7 | |
8 #include "talk/base/signalthread.h" | |
9 | |
10 namespace notifier { | |
11 | |
12 // System specific info needed for changes. | |
13 class PlatformNetworkInfo; | |
14 | |
15 class AsyncNetworkAlive : public talk_base::SignalThread { | |
16 public: | |
17 static AsyncNetworkAlive* Create(); | |
18 | |
19 virtual ~AsyncNetworkAlive() {} | |
20 | |
21 bool alive() const { | |
22 return alive_; | |
23 } | |
24 | |
25 bool error() const { | |
26 return error_; | |
27 } | |
28 | |
29 void SetWaitForNetworkChange(PlatformNetworkInfo* previous_info) { | |
30 network_info_ = previous_info; | |
31 } | |
32 | |
33 PlatformNetworkInfo* ReleaseInfo() { | |
34 PlatformNetworkInfo* info = network_info_; | |
35 network_info_ = NULL; | |
36 return info; | |
37 } | |
38 | |
39 protected: | |
40 AsyncNetworkAlive() : network_info_(NULL), alive_(false), error_(false) { | |
41 } | |
42 | |
43 PlatformNetworkInfo* network_info_; | |
44 bool alive_; | |
45 bool error_; | |
46 | |
47 private: | |
48 DISALLOW_COPY_AND_ASSIGN(AsyncNetworkAlive); | |
49 }; | |
50 | |
51 } // namespace notifier | |
52 | |
53 #endif // CHROME_BROWSER_SYNC_NOTIFIER_BASE_ASYNC_NETWORK_ALIVE_H_ | |
OLD | NEW |