| 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 "base/time.h" | 10 #include "base/time.h" |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 static void NotifyObserversOfNetworkChange(ConnectionType type); | 267 static void NotifyObserversOfNetworkChange(ConnectionType type); |
| 268 | 268 |
| 269 // Stores |config| in NetworkState and notifies observers. | 269 // Stores |config| in NetworkState and notifies observers. |
| 270 static void SetDnsConfig(const DnsConfig& config); | 270 static void SetDnsConfig(const DnsConfig& config); |
| 271 | 271 |
| 272 private: | 272 private: |
| 273 friend class HostResolverImplDnsTest; | 273 friend class HostResolverImplDnsTest; |
| 274 friend class NetworkChangeNotifierAndroidTest; | 274 friend class NetworkChangeNotifierAndroidTest; |
| 275 friend class NetworkChangeNotifierLinuxTest; | 275 friend class NetworkChangeNotifierLinuxTest; |
| 276 friend class NetworkChangeNotifierWinTest; | 276 friend class NetworkChangeNotifierWinTest; |
| 277 friend class URLFetcherMockDNSTest; |
| 277 | 278 |
| 278 class NetworkState; | 279 class NetworkState; |
| 279 class NetworkChangeCalculator; | 280 class NetworkChangeCalculator; |
| 280 | 281 |
| 281 // Allows a second NetworkChangeNotifier to be created for unit testing, so | 282 // Allows a second NetworkChangeNotifier to be created for unit testing, so |
| 282 // the test suite can create a MockNetworkChangeNotifier, but platform | 283 // the test suite can create a MockNetworkChangeNotifier, but platform |
| 283 // specific NetworkChangeNotifiers can also be created for testing. To use, | 284 // specific NetworkChangeNotifiers can also be created for testing. To use, |
| 284 // create an DisableForTest object, and then create the new | 285 // create an DisableForTest object, and then create the new |
| 285 // NetworkChangeNotifier object. The NetworkChangeNotifier must be | 286 // NetworkChangeNotifier object. The NetworkChangeNotifier must be |
| 286 // destroyed before the DisableForTest object, as its destruction will restore | 287 // destroyed before the DisableForTest object, as its destruction will restore |
| (...skipping 25 matching lines...) Expand all Loading... |
| 312 | 313 |
| 313 // Computes NetworkChange signal from IPAddress and ConnectionType signals. | 314 // Computes NetworkChange signal from IPAddress and ConnectionType signals. |
| 314 scoped_ptr<NetworkChangeCalculator> network_change_calculator_; | 315 scoped_ptr<NetworkChangeCalculator> network_change_calculator_; |
| 315 | 316 |
| 316 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); | 317 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); |
| 317 }; | 318 }; |
| 318 | 319 |
| 319 } // namespace net | 320 } // namespace net |
| 320 | 321 |
| 321 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ | 322 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ |
| OLD | NEW |