Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: net/android/network_change_notifier_android.cc

Issue 2776523003: Expose connection subtype from NetworkChangeNotifier (Closed)
Patch Set: Add test Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/android/network_change_notifier_android.h ('k') | net/base/network_change_notifier.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/android/network_change_notifier_android.h ('k') | net/base/network_change_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698