| 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 #include "net/base/network_change_notifier.h" | 5 #include "net/base/network_change_notifier.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/synchronization/lock.h" | 8 #include "base/synchronization/lock.h" |
| 9 #include "base/threading/thread_checker.h" | 9 #include "base/threading/thread_checker.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 unsigned mcc_mnc = 0; | 241 unsigned mcc_mnc = 0; |
| 242 if (type == NetworkChangeNotifier::CONNECTION_2G || | 242 if (type == NetworkChangeNotifier::CONNECTION_2G || |
| 243 type == NetworkChangeNotifier::CONNECTION_3G || | 243 type == NetworkChangeNotifier::CONNECTION_3G || |
| 244 type == NetworkChangeNotifier::CONNECTION_4G) { | 244 type == NetworkChangeNotifier::CONNECTION_4G) { |
| 245 // Log zero if not perfectly converted. | 245 // Log zero if not perfectly converted. |
| 246 if (!base::StringToUint( | 246 if (!base::StringToUint( |
| 247 net::android::GetTelephonyNetworkOperator(), &mcc_mnc)) { | 247 net::android::GetTelephonyNetworkOperator(), &mcc_mnc)) { |
| 248 mcc_mnc = 0; | 248 mcc_mnc = 0; |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 UMA_HISTOGRAM_SPARSE_SLOWLY( | 251 UMA_HISTOGRAM_SPARSE_SLOWLY("NCN.NetworkOperatorMCCMNC", mcc_mnc); |
| 252 "NCN.NetworkOperatorMCCMNC_ConnectionChange", mcc_mnc); | |
| 253 #endif | 252 #endif |
| 254 | 253 |
| 255 UMA_HISTOGRAM_MEDIUM_TIMES( | 254 UMA_HISTOGRAM_MEDIUM_TIMES( |
| 256 "NCN.IPAddressChangeToConnectionTypeChange", | 255 "NCN.IPAddressChangeToConnectionTypeChange", |
| 257 now - last_ip_address_change_); | 256 now - last_ip_address_change_); |
| 258 | 257 |
| 259 offline_packets_received_ = 0; | 258 offline_packets_received_ = 0; |
| 260 bytes_read_since_last_connection_change_ = 0; | 259 bytes_read_since_last_connection_change_ = 0; |
| 261 peak_kbps_since_last_connection_change_ = 0; | 260 peak_kbps_since_last_connection_change_ = 0; |
| 262 last_connection_type_ = type; | 261 last_connection_type_ = type; |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 DCHECK(g_network_change_notifier); | 765 DCHECK(g_network_change_notifier); |
| 767 g_network_change_notifier = NULL; | 766 g_network_change_notifier = NULL; |
| 768 } | 767 } |
| 769 | 768 |
| 770 NetworkChangeNotifier::DisableForTest::~DisableForTest() { | 769 NetworkChangeNotifier::DisableForTest::~DisableForTest() { |
| 771 DCHECK(!g_network_change_notifier); | 770 DCHECK(!g_network_change_notifier); |
| 772 g_network_change_notifier = network_change_notifier_; | 771 g_network_change_notifier = network_change_notifier_; |
| 773 } | 772 } |
| 774 | 773 |
| 775 } // namespace net | 774 } // namespace net |
| OLD | NEW |