OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ | 5 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ |
6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ | 6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/observer_list_threadsafe.h" | 10 #include "base/observer_list_threadsafe.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 NotifyObserversOfIPAddressChange(); | 99 NotifyObserversOfIPAddressChange(); |
100 } | 100 } |
101 | 101 |
102 protected: | 102 protected: |
103 NetworkChangeNotifier(); | 103 NetworkChangeNotifier(); |
104 | 104 |
105 // Broadcasts a notification to all registered observers. Note that this | 105 // Broadcasts a notification to all registered observers. Note that this |
106 // happens asynchronously, even for observers on the current thread, even in | 106 // happens asynchronously, even for observers on the current thread, even in |
107 // tests. | 107 // tests. |
108 static void NotifyObserversOfIPAddressChange(); | 108 static void NotifyObserversOfIPAddressChange(); |
109 void NotifyObserversOfOnlineStateChange(); | 109 static void NotifyObserversOfOnlineStateChange(); |
110 | 110 |
111 private: | 111 private: |
112 const scoped_refptr<ObserverListThreadSafe<IPAddressObserver> > | 112 const scoped_refptr<ObserverListThreadSafe<IPAddressObserver> > |
113 ip_address_observer_list_; | 113 ip_address_observer_list_; |
114 const scoped_refptr<ObserverListThreadSafe<OnlineStateObserver> > | 114 const scoped_refptr<ObserverListThreadSafe<OnlineStateObserver> > |
115 online_state_observer_list_; | 115 online_state_observer_list_; |
116 | 116 |
117 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); | 117 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); |
118 }; | 118 }; |
119 | 119 |
120 } // namespace net | 120 } // namespace net |
121 | 121 |
122 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ | 122 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ |
OLD | NEW |