| 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 //////////////////////////////////////////////////////////////////////////////// | 5 //////////////////////////////////////////////////////////////////////////////// |
| 6 // Threading considerations: | 6 // Threading considerations: |
| 7 // | 7 // |
| 8 // This class is designed to meet various threading guarantees starting from the | 8 // This class is designed to meet various threading guarantees starting from the |
| 9 // ones imposed by NetworkChangeNotifier: | 9 // ones imposed by NetworkChangeNotifier: |
| 10 // - The notifier can be constructed on any thread. | 10 // - The notifier can be constructed on any thread. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 } | 234 } |
| 235 | 235 |
| 236 NetworkChangeNotifierAndroid::NetworkChangeNotifierAndroid( | 236 NetworkChangeNotifierAndroid::NetworkChangeNotifierAndroid( |
| 237 NetworkChangeNotifierDelegateAndroid* delegate, | 237 NetworkChangeNotifierDelegateAndroid* delegate, |
| 238 const DnsConfig* dns_config_for_testing) | 238 const DnsConfig* dns_config_for_testing) |
| 239 : NetworkChangeNotifier(NetworkChangeCalculatorParamsAndroid()), | 239 : NetworkChangeNotifier(NetworkChangeCalculatorParamsAndroid()), |
| 240 delegate_(delegate), | 240 delegate_(delegate), |
| 241 dns_config_service_thread_( | 241 dns_config_service_thread_( |
| 242 new DnsConfigServiceThread(dns_config_for_testing)), | 242 new DnsConfigServiceThread(dns_config_for_testing)), |
| 243 force_network_handles_supported_for_testing_(false) { | 243 force_network_handles_supported_for_testing_(false) { |
| 244 CHECK_EQ(NetId::INVALID, NetworkChangeNotifier::kInvalidNetworkHandle) | 244 // kInvalidNetworkHandle doesn't match NetId::INVALID |
| 245 << "kInvalidNetworkHandle doesn't match NetId::INVALID"; | 245 CHECK_EQ(NetId::INVALID, NetworkChangeNotifier::kInvalidNetworkHandle); |
| 246 delegate_->AddObserver(this); | 246 delegate_->AddObserver(this); |
| 247 dns_config_service_thread_->StartWithOptions( | 247 dns_config_service_thread_->StartWithOptions( |
| 248 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); | 248 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); |
| 249 // Wait until Init is called on the DNS config thread before | 249 // Wait until Init is called on the DNS config thread before |
| 250 // calling InitAfterStart. | 250 // calling InitAfterStart. |
| 251 dns_config_service_thread_->WaitUntilThreadStarted(); | 251 dns_config_service_thread_->WaitUntilThreadStarted(); |
| 252 dns_config_service_thread_->InitAfterStart(); | 252 dns_config_service_thread_->InitAfterStart(); |
| 253 } | 253 } |
| 254 | 254 |
| 255 // static | 255 // static |
| (...skipping 19 matching lines...) Expand all Loading... |
| 275 NetworkChangeNotifier::GetConnectionType(); | 275 NetworkChangeNotifier::GetConnectionType(); |
| 276 NetworkChangeNotifier::LogOperatorCodeHistogram(type); | 276 NetworkChangeNotifier::LogOperatorCodeHistogram(type); |
| 277 if (NetworkChangeNotifier::IsConnectionCellular(type)) { | 277 if (NetworkChangeNotifier::IsConnectionCellular(type)) { |
| 278 UMA_HISTOGRAM_ENUMERATION("NCN.CellularConnectionSubtype", | 278 UMA_HISTOGRAM_ENUMERATION("NCN.CellularConnectionSubtype", |
| 279 delegate_->GetCurrentConnectionSubtype(), | 279 delegate_->GetCurrentConnectionSubtype(), |
| 280 SUBTYPE_LAST + 1); | 280 SUBTYPE_LAST + 1); |
| 281 } | 281 } |
| 282 } | 282 } |
| 283 | 283 |
| 284 } // namespace net | 284 } // namespace net |
| OLD | NEW |