Index: chrome/browser/android/net/external_estimate_provider_android.cc |
diff --git a/chrome/browser/android/net/external_estimate_provider_android.cc b/chrome/browser/android/net/external_estimate_provider_android.cc |
index 2d8c2dbe80ba822a734d8a79d0fbb80eabef2a0d..4a02f3b90ed1e5dfa5b0ea4307bca553c8fd2115 100644 |
--- a/chrome/browser/android/net/external_estimate_provider_android.cc |
+++ b/chrome/browser/android/net/external_estimate_provider_android.cc |
@@ -33,13 +33,6 @@ ExternalEstimateProviderAndroid::~ExternalEstimateProviderAndroid() { |
net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); |
} |
-void ExternalEstimateProviderAndroid::RequestUpdate() const { |
- DCHECK(thread_checker_.CalledOnValidThread()); |
- JNIEnv* env = base::android::AttachCurrentThread(); |
- Java_ExternalEstimateProviderAndroid_requestUpdate( |
- env, j_external_estimate_provider_.obj()); |
-} |
- |
bool ExternalEstimateProviderAndroid::GetRTT(base::TimeDelta* rtt) const { |
DCHECK(thread_checker_.CalledOnValidThread()); |
JNIEnv* env = base::android::AttachCurrentThread(); |
@@ -96,6 +89,23 @@ bool ExternalEstimateProviderAndroid::GetTimeSinceLastUpdate( |
return true; |
} |
+void ExternalEstimateProviderAndroid::SetUpdatedEstimateDelegate( |
+ net::ExternalEstimateProvider::UpdatedEstimateDelegate* delegate) { |
+ delegate_ = delegate; |
+} |
+ |
+void ExternalEstimateProviderAndroid::Update() const { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ JNIEnv* env = base::android::AttachCurrentThread(); |
+ Java_ExternalEstimateProviderAndroid_requestUpdate( |
+ env, j_external_estimate_provider_.obj()); |
+} |
+ |
+void ExternalEstimateProviderAndroid::OnConnectionTypeChanged( |
+ net::NetworkChangeNotifier::ConnectionType type) { |
+ Update(); |
+} |
+ |
void ExternalEstimateProviderAndroid:: |
NotifyExternalEstimateProviderAndroidUpdate(JNIEnv* env, jobject obj) { |
if (!task_runner_) |
@@ -113,19 +123,9 @@ void ExternalEstimateProviderAndroid::NotifyUpdatedEstimateAvailable() const { |
delegate_->OnUpdatedEstimateAvailable(); |
} |
-void ExternalEstimateProviderAndroid::OnConnectionTypeChanged( |
- net::NetworkChangeNotifier::ConnectionType type) { |
- RequestUpdate(); |
-} |
- |
bool RegisterExternalEstimateProviderAndroid(JNIEnv* env) { |
return RegisterNativesImpl(env); |
} |
-void ExternalEstimateProviderAndroid::SetUpdatedEstimateDelegate( |
- net::ExternalEstimateProvider::UpdatedEstimateDelegate* delegate) { |
- delegate_ = delegate; |
-} |
- |
} // namespace android |
} // namespace chrome |