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

Unified Diff: components/cronet/android/chromium_url_request_context.cc

Issue 624443003: Setup ProxyConfigServiceAndroid in Cronet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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: components/cronet/android/chromium_url_request_context.cc
diff --git a/components/cronet/android/chromium_url_request_context.cc b/components/cronet/android/chromium_url_request_context.cc
index f870adfe242d0a14d086ad01af4d754e15a13f39..9bf5c421d3a9fc6e27ef0a0386a37626164be861 100644
--- a/components/cronet/android/chromium_url_request_context.cc
+++ b/components/cronet/android/chromium_url_request_context.cc
@@ -38,6 +38,11 @@ class JniURLRequestContextAdapterDelegate
// The documentation says we should detach just before the thread exits.
}
+ virtual void InitProxyConfigService() OVERRIDE {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ cronet::Java_ChromiumUrlRequestContext_initProxyConfigService(env, owner_);
+ }
+
protected:
virtual ~JniURLRequestContextAdapterDelegate() {
JNIEnv* env = base::android::AttachCurrentThread();
@@ -147,4 +152,14 @@ static void StopNetLog(JNIEnv* env,
adapter->StopNetLog();
}
+// Called on application's main UI thread.
+static void InitProxyConfigServiceOnUIThread(
+ JNIEnv* env,
+ jobject jcaller,
+ jlong urlRequestContextAdapter) {
+ URLRequestContextAdapter* adapter =
+ reinterpret_cast<URLRequestContextAdapter*>(urlRequestContextAdapter);
+ adapter->InitProxyConfigServiceOnUIThread();
+}
+
} // namespace cronet

Powered by Google App Engine
This is Rietveld 408576698