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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 return delegate_->GetCurrentConnectionType(); | 155 return delegate_->GetCurrentConnectionType(); |
156 } | 156 } |
157 | 157 |
158 void NetworkChangeNotifierAndroid::GetCurrentMaxBandwidthAndConnectionType( | 158 void NetworkChangeNotifierAndroid::GetCurrentMaxBandwidthAndConnectionType( |
159 double* max_bandwidth_mbps, | 159 double* max_bandwidth_mbps, |
160 ConnectionType* connection_type) const { | 160 ConnectionType* connection_type) const { |
161 delegate_->GetCurrentMaxBandwidthAndConnectionType(max_bandwidth_mbps, | 161 delegate_->GetCurrentMaxBandwidthAndConnectionType(max_bandwidth_mbps, |
162 connection_type); | 162 connection_type); |
163 } | 163 } |
164 | 164 |
165 bool NetworkChangeNotifierAndroid::AreNetworkHandlesCurrentlySupported() const { | |
166 // Notifications for API using NetworkHandles only implemented for Android | |
pauljensen
2015/11/30 20:23:48
API->APIs
pauljensen
2015/11/30 20:23:48
Notifications->Notifications/querying
Jana
2015/11/30 22:31:06
Modified comment -- see if it's better.
Jana
2015/11/30 22:31:06
Done.
| |
167 // versions >= L. | |
168 return base::android::BuildInfo::GetInstance()->sdk_int() >= | |
169 base::android::SDK_VERSION_LOLLIPOP; | |
170 } | |
171 | |
165 void NetworkChangeNotifierAndroid::GetCurrentConnectedNetworks( | 172 void NetworkChangeNotifierAndroid::GetCurrentConnectedNetworks( |
166 NetworkChangeNotifier::NetworkList* networks) const { | 173 NetworkChangeNotifier::NetworkList* networks) const { |
167 delegate_->GetCurrentlyConnectedNetworks(networks); | 174 delegate_->GetCurrentlyConnectedNetworks(networks); |
168 } | 175 } |
169 | 176 |
170 NetworkChangeNotifier::ConnectionType | 177 NetworkChangeNotifier::ConnectionType |
171 NetworkChangeNotifierAndroid::GetCurrentNetworkConnectionType( | 178 NetworkChangeNotifierAndroid::GetCurrentNetworkConnectionType( |
172 NetworkHandle network) const { | 179 NetworkHandle network) const { |
173 return delegate_->GetNetworkConnectionType(network); | 180 return delegate_->GetNetworkConnectionType(network); |
174 } | 181 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
242 // so delay IPAddressChanged so they get merged with the following | 249 // so delay IPAddressChanged so they get merged with the following |
243 // ConnectionTypeChanged signal. | 250 // ConnectionTypeChanged signal. |
244 params.ip_address_offline_delay_ = base::TimeDelta::FromSeconds(1); | 251 params.ip_address_offline_delay_ = base::TimeDelta::FromSeconds(1); |
245 params.ip_address_online_delay_ = base::TimeDelta::FromSeconds(1); | 252 params.ip_address_online_delay_ = base::TimeDelta::FromSeconds(1); |
246 params.connection_type_offline_delay_ = base::TimeDelta::FromSeconds(0); | 253 params.connection_type_offline_delay_ = base::TimeDelta::FromSeconds(0); |
247 params.connection_type_online_delay_ = base::TimeDelta::FromSeconds(0); | 254 params.connection_type_online_delay_ = base::TimeDelta::FromSeconds(0); |
248 return params; | 255 return params; |
249 } | 256 } |
250 | 257 |
251 } // namespace net | 258 } // namespace net |
OLD | NEW |