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

Unified Diff: net/android/network_change_notifier_delegate_android.cc

Issue 1306653003: Add connection type to NCN::MaxBandwidthChanged (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra space in comment Created 5 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/android/network_change_notifier_delegate_android.h ('k') | net/base/network_change_notifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/android/network_change_notifier_delegate_android.cc
diff --git a/net/android/network_change_notifier_delegate_android.cc b/net/android/network_change_notifier_delegate_android.cc
index ec8a7294995876b4ca09150171f0d1263d97d3f2..be4c6b18e1112853221016ba5a97d90591de13d6 100644
--- a/net/android/network_change_notifier_delegate_android.cc
+++ b/net/android/network_change_notifier_delegate_android.cc
@@ -84,9 +84,13 @@ NetworkChangeNotifierDelegateAndroid::GetCurrentConnectionType() const {
return connection_type_;
}
-double NetworkChangeNotifierDelegateAndroid::GetCurrentMaxBandwidth() const {
+void NetworkChangeNotifierDelegateAndroid::
+ GetCurrentMaxBandwidthAndConnectionType(
+ double* max_bandwidth_mbps,
+ ConnectionType* connection_type) const {
base::AutoLock auto_lock(connection_lock_);
- return connection_max_bandwidth_;
+ *connection_type = connection_type_;
+ *max_bandwidth_mbps = connection_max_bandwidth_;
}
void NetworkChangeNotifierDelegateAndroid::NotifyConnectionTypeChanged(
@@ -111,10 +115,10 @@ void NetworkChangeNotifierDelegateAndroid::NotifyMaxBandwidthChanged(
jobject obj,
jdouble new_max_bandwidth) {
DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(new_max_bandwidth != GetCurrentMaxBandwidth());
+
SetCurrentMaxBandwidth(new_max_bandwidth);
observers_->Notify(FROM_HERE, &Observer::OnMaxBandwidthChanged,
- new_max_bandwidth);
+ new_max_bandwidth, GetCurrentConnectionType());
}
void NetworkChangeNotifierDelegateAndroid::AddObserver(
« no previous file with comments | « net/android/network_change_notifier_delegate_android.h ('k') | net/base/network_change_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698