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/cronet_url_request_context_adapter.cc

Issue 1356933002: make ProxyService::CreateSystemProxyConfigService return scoped_ptrs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: proper namespacing 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: components/cronet/android/cronet_url_request_context_adapter.cc
diff --git a/components/cronet/android/cronet_url_request_context_adapter.cc b/components/cronet/android/cronet_url_request_context_adapter.cc
index 8009eb2a6c2474345770c5b8a0a5d0786d09b3a0..92904411b830f58a4a34759f46629d8b302d8462 100644
--- a/components/cronet/android/cronet_url_request_context_adapter.cc
+++ b/components/cronet/android/cronet_url_request_context_adapter.cc
@@ -148,14 +148,15 @@ void CronetURLRequestContextAdapter::InitRequestContextOnMainThread(
jobject jcaller) {
base::android::ScopedJavaGlobalRef<jobject> jcaller_ref;
jcaller_ref.Reset(env, jcaller);
+ proxy_config_service_ = net::ProxyService::CreateSystemProxyConfigService(
+ GetNetworkTaskRunner(), nullptr /* Ignored on Android */);
net::ProxyConfigServiceAndroid* android_proxy_config_service =
- static_cast<net::ProxyConfigServiceAndroid*>(
- net::ProxyService::CreateSystemProxyConfigService(
- GetNetworkTaskRunner(), nullptr /* Ignored on Android */));
+ static_cast<net::ProxyConfigServiceAndroid*>(proxy_config_service_.get());
// If a PAC URL is present, ignore it and use the address and port of
// Android system's local HTTP proxy server. See: crbug.com/432539.
+ // TODO(csharrison) Architect the wrapper better so we don't need to cast for
+ // android ProxyConfigServices.
android_proxy_config_service->set_exclude_pac_url(true);
- proxy_config_service_.reset(android_proxy_config_service);
GetNetworkTaskRunner()->PostTask(
FROM_HERE,
base::Bind(&CronetURLRequestContextAdapter::InitializeOnNetworkThread,
@@ -200,7 +201,7 @@ void CronetURLRequestContextAdapter::InitializeOnNetworkThread(
// local HTTP proxy. See: crbug.com/432539.
context_builder.set_proxy_service(
net::ProxyService::CreateWithoutProxyResolver(
- proxy_config_service_.release(), net_log_.get()));
+ proxy_config_service_.Pass(), net_log_.get()));
config->ConfigureURLRequestContextBuilder(&context_builder);
// Set up pref file if storage path is specified.
« no previous file with comments | « chromecast/browser/url_request_context_factory.cc ('k') | components/cronet/android/url_request_context_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698