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

Unified Diff: net/android/network_change_notifier_delegate_android.cc

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
« no previous file with comments | « net/android/network_change_notifier_delegate_android.h ('k') | net/base/net_log_event_type_list.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 a6a71322586998df43233ff8ffb12faa13ce48b0..99a6cc2d771432d3943726612d989e83b3f98f15 100644
--- a/net/android/network_change_notifier_delegate_android.cc
+++ b/net/android/network_change_notifier_delegate_android.cc
@@ -64,8 +64,9 @@ NetworkChangeNotifierDelegateAndroid::NetworkChangeNotifierDelegateAndroid()
ConvertConnectionType(
Java_NetworkChangeNotifier_getCurrentConnectionType(
env, java_network_change_notifier_.obj())));
- SetCurrentMaxBandwidth(Java_NetworkChangeNotifier_getCurrentMaxBandwidth(
- env, java_network_change_notifier_.obj()));
+ SetCurrentMaxBandwidth(
+ Java_NetworkChangeNotifier_getCurrentMaxBandwidthInMbps(
+ env, java_network_change_notifier_.obj()));
}
NetworkChangeNotifierDelegateAndroid::~NetworkChangeNotifierDelegateAndroid() {
@@ -96,8 +97,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 +106,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 != GetCurrentMaxBandwidth());
+ SetCurrentMaxBandwidth(new_max_bandwidth);
+ observers_->Notify(&Observer::OnMaxBandwidthChanged, new_max_bandwidth);
+}
+
void NetworkChangeNotifierDelegateAndroid::AddObserver(
Observer* observer) {
observers_->AddObserver(observer);
« no previous file with comments | « net/android/network_change_notifier_delegate_android.h ('k') | net/base/net_log_event_type_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698