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

Unified Diff: net/android/network_change_notifier_delegate_android.cc

Issue 780293003: [NetInfo] Add MaxBandwidthChanged notification and implement on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@maxbandwidth_android
Patch Set: Don't monitor RSSI if there is no permission to act on it Created 6 years 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
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 a6a71322586998df43233ff8ffb12faa13ce48b0..1aa1ec596ea80df00f481cdcd3e481bf7cf34c85 100644
--- a/net/android/network_change_notifier_delegate_android.cc
+++ b/net/android/network_change_notifier_delegate_android.cc
@@ -96,8 +96,6 @@ void NetworkChangeNotifierDelegateAndroid::NotifyConnectionTypeChanged(
const ConnectionType actual_connection_type = ConvertConnectionType(
new_connection_type);
SetCurrentConnectionType(actual_connection_type);
- SetCurrentMaxBandwidth(Java_NetworkChangeNotifier_getCurrentMaxBandwidth(
- env, java_network_change_notifier_.obj()));
observers_->Notify(&Observer::OnConnectionTypeChanged);
}
@@ -107,6 +105,16 @@ jint NetworkChangeNotifierDelegateAndroid::GetConnectionType(JNIEnv*,
return GetCurrentConnectionType();
}
+void NetworkChangeNotifierDelegateAndroid::NotifyMaxBandwidthChanged(
+ JNIEnv* env,
+ jobject obj,
+ jdouble new_max_bandwidth) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(new_max_bandwidth != connection_max_bandwidth_);
pauljensen 2014/12/11 16:13:57 I think this is missing the lock; shouldn't it cal
jkarlin 2014/12/15 19:43:55 Done. Thanks!
+ SetCurrentMaxBandwidth(new_max_bandwidth);
+ observers_->Notify(&Observer::OnMaxBandwidthChanged, new_max_bandwidth);
+}
+
void NetworkChangeNotifierDelegateAndroid::AddObserver(
Observer* observer) {
observers_->AddObserver(observer);

Powered by Google App Engine
This is Rietveld 408576698