| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // NetworkChangeNotifier::NetworkChangeObserver implementation: | 135 // NetworkChangeNotifier::NetworkChangeObserver implementation: |
| 136 void OnNetworkChanged(NetworkChangeNotifier::ConnectionType type) override { | 136 void OnNetworkChanged(NetworkChangeNotifier::ConnectionType type) override { |
| 137 task_runner()->PostTask( | 137 task_runner()->PostTask( |
| 138 FROM_HERE, | 138 FROM_HERE, |
| 139 base::Bind(&internal::DnsConfigServicePosix::OnNetworkChanged, | 139 base::Bind(&internal::DnsConfigServicePosix::OnNetworkChanged, |
| 140 base::Unretained(dns_config_service_.get()), type)); | 140 base::Unretained(dns_config_service_.get()), type)); |
| 141 } | 141 } |
| 142 | 142 |
| 143 const DnsConfig* dns_config_for_testing_; | 143 const DnsConfig* dns_config_for_testing_; |
| 144 const base::Time creation_time_; | 144 const base::Time creation_time_; |
| 145 scoped_ptr<internal::DnsConfigServicePosix> dns_config_service_; | 145 std::unique_ptr<internal::DnsConfigServicePosix> dns_config_service_; |
| 146 // Used to detect tunnel state changes. | 146 // Used to detect tunnel state changes. |
| 147 internal::AddressTrackerLinux address_tracker_; | 147 internal::AddressTrackerLinux address_tracker_; |
| 148 | 148 |
| 149 DISALLOW_COPY_AND_ASSIGN(DnsConfigServiceThread); | 149 DISALLOW_COPY_AND_ASSIGN(DnsConfigServiceThread); |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 NetworkChangeNotifierAndroid::~NetworkChangeNotifierAndroid() { | 152 NetworkChangeNotifierAndroid::~NetworkChangeNotifierAndroid() { |
| 153 delegate_->RemoveObserver(this); | 153 delegate_->RemoveObserver(this); |
| 154 } | 154 } |
| 155 | 155 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 NetworkChangeNotifier::GetConnectionType(); | 273 NetworkChangeNotifier::GetConnectionType(); |
| 274 NetworkChangeNotifier::LogOperatorCodeHistogram(type); | 274 NetworkChangeNotifier::LogOperatorCodeHistogram(type); |
| 275 if (NetworkChangeNotifier::IsConnectionCellular(type)) { | 275 if (NetworkChangeNotifier::IsConnectionCellular(type)) { |
| 276 UMA_HISTOGRAM_ENUMERATION("NCN.CellularConnectionSubtype", | 276 UMA_HISTOGRAM_ENUMERATION("NCN.CellularConnectionSubtype", |
| 277 delegate_->GetCurrentConnectionSubtype(), | 277 delegate_->GetCurrentConnectionSubtype(), |
| 278 SUBTYPE_LAST + 1); | 278 SUBTYPE_LAST + 1); |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 | 281 |
| 282 } // namespace net | 282 } // namespace net |
| OLD | NEW |