| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/observer_list_threadsafe.h" | 9 #include "base/observer_list_threadsafe.h" |
| 10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 static void NotifyObserversOfDNSChange(); | 202 static void NotifyObserversOfDNSChange(); |
| 203 | 203 |
| 204 // Stores |config| in NetworkState and notifies observers. | 204 // Stores |config| in NetworkState and notifies observers. |
| 205 static void SetDnsConfig(const DnsConfig& config); | 205 static void SetDnsConfig(const DnsConfig& config); |
| 206 | 206 |
| 207 private: | 207 private: |
| 208 friend class HostResolverImplDnsTest; | 208 friend class HostResolverImplDnsTest; |
| 209 friend class NetworkChangeNotifierAndroidTest; | 209 friend class NetworkChangeNotifierAndroidTest; |
| 210 friend class NetworkChangeNotifierLinuxTest; | 210 friend class NetworkChangeNotifierLinuxTest; |
| 211 friend class NetworkChangeNotifierWinTest; | 211 friend class NetworkChangeNotifierWinTest; |
| 212 friend class URLFetcherTest; |
| 212 | 213 |
| 213 class NetworkState; | 214 class NetworkState; |
| 214 | 215 |
| 215 // Allows a second NetworkChangeNotifier to be created for unit testing, so | 216 // Allows a second NetworkChangeNotifier to be created for unit testing, so |
| 216 // the test suite can create a MockNetworkChangeNotifier, but platform | 217 // the test suite can create a MockNetworkChangeNotifier, but platform |
| 217 // specific NetworkChangeNotifiers can also be created for testing. To use, | 218 // specific NetworkChangeNotifiers can also be created for testing. To use, |
| 218 // create an DisableForTest object, and then create the new | 219 // create an DisableForTest object, and then create the new |
| 219 // NetworkChangeNotifier object. The NetworkChangeNotifier must be | 220 // NetworkChangeNotifier object. The NetworkChangeNotifier must be |
| 220 // destroyed before the DisableForTest object, as its destruction will restore | 221 // destroyed before the DisableForTest object, as its destruction will restore |
| 221 // the original NetworkChangeNotifier. | 222 // the original NetworkChangeNotifier. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 241 | 242 |
| 242 // A little-piggy-back observer that simply logs UMA histogram data. | 243 // A little-piggy-back observer that simply logs UMA histogram data. |
| 243 scoped_ptr<HistogramWatcher> histogram_watcher_; | 244 scoped_ptr<HistogramWatcher> histogram_watcher_; |
| 244 | 245 |
| 245 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); | 246 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); |
| 246 }; | 247 }; |
| 247 | 248 |
| 248 } // namespace net | 249 } // namespace net |
| 249 | 250 |
| 250 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ | 251 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ |
| OLD | NEW |