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

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: Comments 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 double NetworkChangeNotifierAndroid::GetCurrentMaxBandwidth() const { 147 double NetworkChangeNotifierAndroid::GetCurrentMaxBandwidth() const {
148 return delegate_->GetCurrentMaxBandwidth(); 148 return delegate_->GetCurrentMaxBandwidth();
149 } 149 }
150 150
151 void NetworkChangeNotifierAndroid::OnConnectionTypeChanged() { 151 void NetworkChangeNotifierAndroid::OnConnectionTypeChanged() {
152 DnsConfigServiceThread::NotifyNetworkChangeNotifierObservers(); 152 DnsConfigServiceThread::NotifyNetworkChangeNotifierObservers();
153 } 153 }
154 154
155 void NetworkChangeNotifierAndroid::OnMaxBandwidthChanged( 155 void NetworkChangeNotifierAndroid::OnMaxBandwidthChanged(
156 ConnectionType type,
156 double max_bandwidth_mbps) { 157 double max_bandwidth_mbps) {
157 NetworkChangeNotifier::NotifyObserversOfMaxBandwidthChange( 158 NetworkChangeNotifier::NotifyObserversOfMaxBandwidthChange(
158 max_bandwidth_mbps); 159 type, max_bandwidth_mbps);
159 } 160 }
160 161
161 // static 162 // static
162 bool NetworkChangeNotifierAndroid::Register(JNIEnv* env) { 163 bool NetworkChangeNotifierAndroid::Register(JNIEnv* env) {
163 return NetworkChangeNotifierDelegateAndroid::Register(env); 164 return NetworkChangeNotifierDelegateAndroid::Register(env);
164 } 165 }
165 166
166 NetworkChangeNotifierAndroid::NetworkChangeNotifierAndroid( 167 NetworkChangeNotifierAndroid::NetworkChangeNotifierAndroid(
167 NetworkChangeNotifierDelegateAndroid* delegate, 168 NetworkChangeNotifierDelegateAndroid* delegate,
168 const DnsConfig* dns_config_for_testing) 169 const DnsConfig* dns_config_for_testing)
(...skipping 18 matching lines...) Expand all
187 // so delay IPAddressChanged so they get merged with the following 188 // so delay IPAddressChanged so they get merged with the following
188 // ConnectionTypeChanged signal. 189 // ConnectionTypeChanged signal.
189 params.ip_address_offline_delay_ = base::TimeDelta::FromSeconds(1); 190 params.ip_address_offline_delay_ = base::TimeDelta::FromSeconds(1);
190 params.ip_address_online_delay_ = base::TimeDelta::FromSeconds(1); 191 params.ip_address_online_delay_ = base::TimeDelta::FromSeconds(1);
191 params.connection_type_offline_delay_ = base::TimeDelta::FromSeconds(0); 192 params.connection_type_offline_delay_ = base::TimeDelta::FromSeconds(0);
192 params.connection_type_online_delay_ = base::TimeDelta::FromSeconds(0); 193 params.connection_type_online_delay_ = base::TimeDelta::FromSeconds(0);
193 return params; 194 return params;
194 } 195 }
195 196
196 } // namespace net 197 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698