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

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

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 115 }
116 116
117 double NetworkChangeNotifierAndroid::GetCurrentMaxBandwidth() const { 117 double NetworkChangeNotifierAndroid::GetCurrentMaxBandwidth() const {
118 return delegate_->GetCurrentMaxBandwidth(); 118 return delegate_->GetCurrentMaxBandwidth();
119 } 119 }
120 120
121 void NetworkChangeNotifierAndroid::OnConnectionTypeChanged() { 121 void NetworkChangeNotifierAndroid::OnConnectionTypeChanged() {
122 DnsConfigServiceThread::NotifyNetworkChangeNotifierObservers(); 122 DnsConfigServiceThread::NotifyNetworkChangeNotifierObservers();
123 } 123 }
124 124
125 void NetworkChangeNotifierAndroid::OnMaxBandwidthChanged(
126 double max_bandwidth_mbps) {
127 NetworkChangeNotifier::NotifyObserversOfMaxBandwidthChange(
128 max_bandwidth_mbps);
129 }
130
125 // static 131 // static
126 bool NetworkChangeNotifierAndroid::Register(JNIEnv* env) { 132 bool NetworkChangeNotifierAndroid::Register(JNIEnv* env) {
127 return NetworkChangeNotifierDelegateAndroid::Register(env); 133 return NetworkChangeNotifierDelegateAndroid::Register(env);
128 } 134 }
129 135
130 NetworkChangeNotifierAndroid::NetworkChangeNotifierAndroid( 136 NetworkChangeNotifierAndroid::NetworkChangeNotifierAndroid(
131 NetworkChangeNotifierDelegateAndroid* delegate) 137 NetworkChangeNotifierDelegateAndroid* delegate)
132 : NetworkChangeNotifier(NetworkChangeCalculatorParamsAndroid()), 138 : NetworkChangeNotifier(NetworkChangeCalculatorParamsAndroid()),
133 delegate_(delegate), 139 delegate_(delegate),
134 dns_config_service_thread_(new DnsConfigServiceThread()) { 140 dns_config_service_thread_(new DnsConfigServiceThread()) {
(...skipping 10 matching lines...) Expand all
145 // so delay IPAddressChanged so they get merged with the following 151 // so delay IPAddressChanged so they get merged with the following
146 // ConnectionTypeChanged signal. 152 // ConnectionTypeChanged signal.
147 params.ip_address_offline_delay_ = base::TimeDelta::FromSeconds(1); 153 params.ip_address_offline_delay_ = base::TimeDelta::FromSeconds(1);
148 params.ip_address_online_delay_ = base::TimeDelta::FromSeconds(1); 154 params.ip_address_online_delay_ = base::TimeDelta::FromSeconds(1);
149 params.connection_type_offline_delay_ = base::TimeDelta::FromSeconds(0); 155 params.connection_type_offline_delay_ = base::TimeDelta::FromSeconds(0);
150 params.connection_type_online_delay_ = base::TimeDelta::FromSeconds(0); 156 params.connection_type_online_delay_ = base::TimeDelta::FromSeconds(0);
151 return params; 157 return params;
152 } 158 }
153 159
154 } // namespace net 160 } // 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