diff options
author | jkarlin <jkarlin@chromium.org> | 2015-09-18 08:14:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-18 15:14:46 +0000 |
commit | bce491860ced584a398c76dca134ed350e879259 (patch) | |
tree | 6bb790ce0e6a72a77c9577eb043cc7fd2ffaafc5 /chromeos/network | |
parent | 57388833dcb6bf4f472ff94bd2c224abe0529140 (diff) | |
download | chromium_src-bce491860ced584a398c76dca134ed350e879259.zip chromium_src-bce491860ced584a398c76dca134ed350e879259.tar.gz chromium_src-bce491860ced584a398c76dca134ed350e879259.tar.bz2 |
This CL adds ConnectionType to the MaxBandwidthObserver notification as a convenience for its only client (in the downstream CL), NetInfo.
This CL also ensures that MaxBandwidthObserver is called on every platform when the network type changes.
Upstream of https://codereview.chromium.org/1306423004/
BUG=412741
Review URL: https://codereview.chromium.org/1306653003
Cr-Commit-Position: refs/heads/master@{#349673}
Diffstat (limited to 'chromeos/network')
-rw-r--r-- | chromeos/network/network_change_notifier_chromeos.cc | 12 | ||||
-rw-r--r-- | chromeos/network/network_change_notifier_chromeos.h | 4 |
2 files changed, 11 insertions, 5 deletions
diff --git a/chromeos/network/network_change_notifier_chromeos.cc b/chromeos/network/network_change_notifier_chromeos.cc index 52ee616..a232997 100644 --- a/chromeos/network/network_change_notifier_chromeos.cc +++ b/chromeos/network/network_change_notifier_chromeos.cc @@ -102,8 +102,11 @@ NetworkChangeNotifierChromeos::GetCurrentConnectionType() const { return connection_type_; } -double NetworkChangeNotifierChromeos::GetCurrentMaxBandwidth() const { - return max_bandwidth_mbps_; +void NetworkChangeNotifierChromeos::GetCurrentMaxBandwidthAndConnectionType( + double* max_bandwidth_mbps, + ConnectionType* connection_type) const { + *connection_type = connection_type_; + *max_bandwidth_mbps = max_bandwidth_mbps_; } void NetworkChangeNotifierChromeos::SuspendDone( @@ -129,9 +132,10 @@ void NetworkChangeNotifierChromeos::DefaultNetworkChanged( NetworkChangeNotifier::NotifyObserversOfIPAddressChange(); if (dns_changed) dns_config_service_->OnNetworkChange(); - if (max_bandwidth_changed) + if (max_bandwidth_changed || connection_type_changed) { NetworkChangeNotifier::NotifyObserversOfMaxBandwidthChange( - max_bandwidth_mbps_); + max_bandwidth_mbps_, connection_type_); + } } void NetworkChangeNotifierChromeos::UpdateState( diff --git a/chromeos/network/network_change_notifier_chromeos.h b/chromeos/network/network_change_notifier_chromeos.h index d7557e5..d8b7292 100644 --- a/chromeos/network/network_change_notifier_chromeos.h +++ b/chromeos/network/network_change_notifier_chromeos.h @@ -37,7 +37,9 @@ class CHROMEOS_EXPORT NetworkChangeNotifierChromeos // NetworkChangeNotifier overrides. net::NetworkChangeNotifier::ConnectionType GetCurrentConnectionType() const override; - double GetCurrentMaxBandwidth() const override; + void GetCurrentMaxBandwidthAndConnectionType( + double* max_bandwidth_mbps, + ConnectionType* connection_type) const override; // PowerManagerClient::Observer overrides. void SuspendDone(const base::TimeDelta& sleep_duration) override; |