| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |