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