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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
153 | 153 |
154 NetworkChangeNotifierAndroid::~NetworkChangeNotifierAndroid() { | 154 NetworkChangeNotifierAndroid::~NetworkChangeNotifierAndroid() { |
155 delegate_->RemoveObserver(this); | 155 delegate_->RemoveObserver(this); |
156 } | 156 } |
157 | 157 |
158 NetworkChangeNotifier::ConnectionType | 158 NetworkChangeNotifier::ConnectionType |
159 NetworkChangeNotifierAndroid::GetCurrentConnectionType() const { | 159 NetworkChangeNotifierAndroid::GetCurrentConnectionType() const { |
160 return delegate_->GetCurrentConnectionType(); | 160 return delegate_->GetCurrentConnectionType(); |
161 } | 161 } |
162 | 162 |
163 NetworkChangeNotifier::ConnectionSubtype | |
164 NetworkChangeNotifierAndroid::GetCurrentConnectionSubtype() const { | |
165 return delegate_->GetCurrentConnectionSubtype(); | |
pauljensen
2017/05/10 16:47:07
Hmm this is a potential threading violation. NCN:
tbansal1
2017/05/11 01:08:52
I will send a CL tomorrow to fix this. Thanks for
| |
166 } | |
167 | |
163 void NetworkChangeNotifierAndroid::GetCurrentMaxBandwidthAndConnectionType( | 168 void NetworkChangeNotifierAndroid::GetCurrentMaxBandwidthAndConnectionType( |
164 double* max_bandwidth_mbps, | 169 double* max_bandwidth_mbps, |
165 ConnectionType* connection_type) const { | 170 ConnectionType* connection_type) const { |
166 delegate_->GetCurrentMaxBandwidthAndConnectionType(max_bandwidth_mbps, | 171 delegate_->GetCurrentMaxBandwidthAndConnectionType(max_bandwidth_mbps, |
167 connection_type); | 172 connection_type); |
168 } | 173 } |
169 | 174 |
170 void NetworkChangeNotifierAndroid::ForceNetworkHandlesSupportedForTesting() { | 175 void NetworkChangeNotifierAndroid::ForceNetworkHandlesSupportedForTesting() { |
171 force_network_handles_supported_for_testing_ = true; | 176 force_network_handles_supported_for_testing_ = true; |
172 } | 177 } |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
275 NetworkChangeNotifier::GetConnectionType(); | 280 NetworkChangeNotifier::GetConnectionType(); |
276 NetworkChangeNotifier::LogOperatorCodeHistogram(type); | 281 NetworkChangeNotifier::LogOperatorCodeHistogram(type); |
277 if (NetworkChangeNotifier::IsConnectionCellular(type)) { | 282 if (NetworkChangeNotifier::IsConnectionCellular(type)) { |
278 UMA_HISTOGRAM_ENUMERATION("NCN.CellularConnectionSubtype", | 283 UMA_HISTOGRAM_ENUMERATION("NCN.CellularConnectionSubtype", |
279 delegate_->GetCurrentConnectionSubtype(), | 284 delegate_->GetCurrentConnectionSubtype(), |
280 SUBTYPE_LAST + 1); | 285 SUBTYPE_LAST + 1); |
281 } | 286 } |
282 } | 287 } |
283 | 288 |
284 } // namespace net | 289 } // namespace net |
OLD | NEW |