| 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/time.h" | 10 #include "base/time/time.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // Register the Observer callbacks for producing histogram data. This | 225 // Register the Observer callbacks for producing histogram data. This |
| 226 // should be called from the network thread to avoid race conditions. | 226 // should be called from the network thread to avoid race conditions. |
| 227 // ShutdownHistogramWatcher() must be called prior to NetworkChangeNotifier | 227 // ShutdownHistogramWatcher() must be called prior to NetworkChangeNotifier |
| 228 // destruction. | 228 // destruction. |
| 229 static void InitHistogramWatcher(); | 229 static void InitHistogramWatcher(); |
| 230 | 230 |
| 231 // Unregister the Observer callbacks for producing histogram data. This | 231 // Unregister the Observer callbacks for producing histogram data. This |
| 232 // should be called from the network thread to avoid race conditions. | 232 // should be called from the network thread to avoid race conditions. |
| 233 static void ShutdownHistogramWatcher(); | 233 static void ShutdownHistogramWatcher(); |
| 234 | 234 |
| 235 // Log the |NCN.NetworkOperatorMCCMNC| histogram. |
| 236 static void LogOperatorCodeHistogram(ConnectionType type); |
| 237 |
| 235 // Allows a second NetworkChangeNotifier to be created for unit testing, so | 238 // Allows a second NetworkChangeNotifier to be created for unit testing, so |
| 236 // the test suite can create a MockNetworkChangeNotifier, but platform | 239 // the test suite can create a MockNetworkChangeNotifier, but platform |
| 237 // specific NetworkChangeNotifiers can also be created for testing. To use, | 240 // specific NetworkChangeNotifiers can also be created for testing. To use, |
| 238 // create an DisableForTest object, and then create the new | 241 // create an DisableForTest object, and then create the new |
| 239 // NetworkChangeNotifier object. The NetworkChangeNotifier must be | 242 // NetworkChangeNotifier object. The NetworkChangeNotifier must be |
| 240 // destroyed before the DisableForTest object, as its destruction will restore | 243 // destroyed before the DisableForTest object, as its destruction will restore |
| 241 // the original NetworkChangeNotifier. | 244 // the original NetworkChangeNotifier. |
| 242 class NET_EXPORT DisableForTest { | 245 class NET_EXPORT DisableForTest { |
| 243 public: | 246 public: |
| 244 DisableForTest(); | 247 DisableForTest(); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 323 |
| 321 // Computes NetworkChange signal from IPAddress and ConnectionType signals. | 324 // Computes NetworkChange signal from IPAddress and ConnectionType signals. |
| 322 scoped_ptr<NetworkChangeCalculator> network_change_calculator_; | 325 scoped_ptr<NetworkChangeCalculator> network_change_calculator_; |
| 323 | 326 |
| 324 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); | 327 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier); |
| 325 }; | 328 }; |
| 326 | 329 |
| 327 } // namespace net | 330 } // namespace net |
| 328 | 331 |
| 329 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ | 332 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ |
| OLD | NEW |