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

Unified Diff: chrome/browser/android/net/external_estimate_provider_android.cc

Issue 1316863006: Populate EEP estimate in NQE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use EXPECT_TRUE instead of DCHECK 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
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

Powered by Google App Engine
This is Rietveld 408576698