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

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

Issue 1306653003: Add connection type to NCN::MaxBandwidthChanged (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra space in comment Created 5 years, 3 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
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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 NetworkChangeNotifierAndroid::~NetworkChangeNotifierAndroid() { 138 NetworkChangeNotifierAndroid::~NetworkChangeNotifierAndroid() {
139 delegate_->RemoveObserver(this); 139 delegate_->RemoveObserver(this);
140 } 140 }
141 141
142 NetworkChangeNotifier::ConnectionType 142 NetworkChangeNotifier::ConnectionType
143 NetworkChangeNotifierAndroid::GetCurrentConnectionType() const { 143 NetworkChangeNotifierAndroid::GetCurrentConnectionType() const {
144 return delegate_->GetCurrentConnectionType(); 144 return delegate_->GetCurrentConnectionType();
145 } 145 }
146 146
147 double NetworkChangeNotifierAndroid::GetCurrentMaxBandwidth() const { 147 void NetworkChangeNotifierAndroid::GetCurrentMaxBandwidthAndConnectionType(
148 return delegate_->GetCurrentMaxBandwidth(); 148 double* max_bandwidth_mbps,
149 ConnectionType* connection_type) const {
150 delegate_->GetCurrentMaxBandwidthAndConnectionType(max_bandwidth_mbps,
151 connection_type);
149 } 152 }
150 153
151 void NetworkChangeNotifierAndroid::OnConnectionTypeChanged() { 154 void NetworkChangeNotifierAndroid::OnConnectionTypeChanged() {
152 DnsConfigServiceThread::NotifyNetworkChangeNotifierObservers(); 155 DnsConfigServiceThread::NotifyNetworkChangeNotifierObservers();
153 } 156 }
154 157
155 void NetworkChangeNotifierAndroid::OnMaxBandwidthChanged( 158 void NetworkChangeNotifierAndroid::OnMaxBandwidthChanged(
156 double max_bandwidth_mbps) { 159 double max_bandwidth_mbps,
157 NetworkChangeNotifier::NotifyObserversOfMaxBandwidthChange( 160 ConnectionType type) {
158 max_bandwidth_mbps); 161 NetworkChangeNotifier::NotifyObserversOfMaxBandwidthChange(max_bandwidth_mbps,
162 type);
159 } 163 }
160 164
161 // static 165 // static
162 bool NetworkChangeNotifierAndroid::Register(JNIEnv* env) { 166 bool NetworkChangeNotifierAndroid::Register(JNIEnv* env) {
163 return NetworkChangeNotifierDelegateAndroid::Register(env); 167 return NetworkChangeNotifierDelegateAndroid::Register(env);
164 } 168 }
165 169
166 NetworkChangeNotifierAndroid::NetworkChangeNotifierAndroid( 170 NetworkChangeNotifierAndroid::NetworkChangeNotifierAndroid(
167 NetworkChangeNotifierDelegateAndroid* delegate, 171 NetworkChangeNotifierDelegateAndroid* delegate,
168 const DnsConfig* dns_config_for_testing) 172 const DnsConfig* dns_config_for_testing)
(...skipping 18 matching lines...) Expand all
187 // so delay IPAddressChanged so they get merged with the following 191 // so delay IPAddressChanged so they get merged with the following
188 // ConnectionTypeChanged signal. 192 // ConnectionTypeChanged signal.
189 params.ip_address_offline_delay_ = base::TimeDelta::FromSeconds(1); 193 params.ip_address_offline_delay_ = base::TimeDelta::FromSeconds(1);
190 params.ip_address_online_delay_ = base::TimeDelta::FromSeconds(1); 194 params.ip_address_online_delay_ = base::TimeDelta::FromSeconds(1);
191 params.connection_type_offline_delay_ = base::TimeDelta::FromSeconds(0); 195 params.connection_type_offline_delay_ = base::TimeDelta::FromSeconds(0);
192 params.connection_type_online_delay_ = base::TimeDelta::FromSeconds(0); 196 params.connection_type_online_delay_ = base::TimeDelta::FromSeconds(0);
193 return params; 197 return params;
194 } 198 }
195 199
196 } // namespace net 200 } // namespace net
OLDNEW
« no previous file with comments | « net/android/network_change_notifier_android.h ('k') | net/android/network_change_notifier_android_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698