| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // tests. | 187 // tests. |
| 188 static void NotifyObserversOfIPAddressChange(); | 188 static void NotifyObserversOfIPAddressChange(); |
| 189 static void NotifyObserversOfConnectionTypeChange(); | 189 static void NotifyObserversOfConnectionTypeChange(); |
| 190 static void NotifyObserversOfDNSChange(); | 190 static void NotifyObserversOfDNSChange(); |
| 191 | 191 |
| 192 // Stores |config| in NetworkState and notifies observers. | 192 // Stores |config| in NetworkState and notifies observers. |
| 193 static void SetDnsConfig(const DnsConfig& config); | 193 static void SetDnsConfig(const DnsConfig& config); |
| 194 | 194 |
| 195 private: | 195 private: |
| 196 friend class HostResolverImplDnsTest; | 196 friend class HostResolverImplDnsTest; |
| 197 friend class NetworkChangeNotifierAndroidTest; |
| 197 friend class NetworkChangeNotifierLinuxTest; | 198 friend class NetworkChangeNotifierLinuxTest; |
| 198 friend class NetworkChangeNotifierWinTest; | 199 friend class NetworkChangeNotifierWinTest; |
| 199 | 200 |
| 200 class NetworkState; | 201 class NetworkState; |
| 201 | 202 |
| 202 // Allows a second NetworkChangeNotifier to be created for unit testing, so | 203 // Allows a second NetworkChangeNotifier to be created for unit testing, so |
| 203 // the test suite can create a MockNetworkChangeNotifier, but platform | 204 // the test suite can create a MockNetworkChangeNotifier, but platform |
| 204 // specific NetworkChangeNotifiers can also be created for testing. To use, | 205 // specific NetworkChangeNotifiers can also be created for testing. To use, |
| 205 // create an DisableForTest object, and then create the new | 206 // create an DisableForTest object, and then create the new |
| 206 // NetworkChangeNotifier object. The NetworkChangeNotifier must be | 207 // NetworkChangeNotifier object. The NetworkChangeNotifier must be |
| (...skipping 21 matching lines...) Expand all Loading... |
| 228 | 229 |
| 229 // A little-piggy-back observer that simply logs UMA histogram data. | 230 // A little-piggy-back observer that simply logs UMA histogram data. |
| 230 scoped_ptr<HistogramWatcher> histogram_watcher_; | 231 scoped_ptr<HistogramWatcher> histogram_watcher_; |
| 231 | 232 |
| 232 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); | 233 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); |
| 233 }; | 234 }; |
| 234 | 235 |
| 235 } // namespace net | 236 } // namespace net |
| 236 | 237 |
| 237 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ | 238 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ |
| OLD | NEW |