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

Side by Side Diff: android_webview/browser/aw_browser_context.cc

Issue 742023003: Enable using system proxy resolver for android webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address eroman's comments Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | android_webview/browser/net/aw_url_request_context_getter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/browser/aw_browser_context.h" 5 #include "android_webview/browser/aw_browser_context.h"
6 6
7 #include "android_webview/browser/aw_form_database_service.h" 7 #include "android_webview/browser/aw_form_database_service.h"
8 #include "android_webview/browser/aw_pref_store.h" 8 #include "android_webview/browser/aw_pref_store.h"
9 #include "android_webview/browser/aw_quota_manager_bridge.h" 9 #include "android_webview/browser/aw_quota_manager_bridge.h"
10 #include "android_webview/browser/aw_resource_context.h" 10 #include "android_webview/browser/aw_resource_context.h"
(...skipping 10 matching lines...) Expand all
21 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" 21 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h"
22 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat istics_prefs.h" 22 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat istics_prefs.h"
23 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" 23 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h"
24 #include "components/user_prefs/user_prefs.h" 24 #include "components/user_prefs/user_prefs.h"
25 #include "components/visitedlink/browser/visitedlink_master.h" 25 #include "components/visitedlink/browser/visitedlink_master.h"
26 #include "content/public/browser/browser_thread.h" 26 #include "content/public/browser/browser_thread.h"
27 #include "content/public/browser/ssl_host_state_delegate.h" 27 #include "content/public/browser/ssl_host_state_delegate.h"
28 #include "content/public/browser/storage_partition.h" 28 #include "content/public/browser/storage_partition.h"
29 #include "content/public/browser/web_contents.h" 29 #include "content/public/browser/web_contents.h"
30 #include "net/cookies/cookie_store.h" 30 #include "net/cookies/cookie_store.h"
31 #include "net/proxy/proxy_config_service_android.h"
31 #include "net/proxy/proxy_service.h" 32 #include "net/proxy/proxy_service.h"
32 33
33 using base::FilePath; 34 using base::FilePath;
34 using content::BrowserThread; 35 using content::BrowserThread;
35 using data_reduction_proxy::DataReductionProxyConfigService; 36 using data_reduction_proxy::DataReductionProxyConfigService;
36 using data_reduction_proxy::DataReductionProxySettings; 37 using data_reduction_proxy::DataReductionProxySettings;
37 38
38 namespace android_webview { 39 namespace android_webview {
39 40
40 namespace { 41 namespace {
41 42
42 // Shows notifications which correspond to PersistentPrefStore's reading errors. 43 // Shows notifications which correspond to PersistentPrefStore's reading errors.
43 void HandleReadError(PersistentPrefStore::PrefReadError error) { 44 void HandleReadError(PersistentPrefStore::PrefReadError error) {
44 } 45 }
45 46
46 AwBrowserContext* g_browser_context = NULL; 47 AwBrowserContext* g_browser_context = NULL;
47 48
49 net::ProxyConfigService* CreateProxyConfigService() {
50 net::ProxyConfigServiceAndroid* config_service =
51 static_cast<net::ProxyConfigServiceAndroid*>(
52 net::ProxyService::CreateSystemProxyConfigService(
53 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
54 nullptr /* Ignored on Android */ ));
55 config_service->set_exclude_pac_url(true);
56 return config_service;
57 }
58
48 } // namespace 59 } // namespace
49 60
50 // Data reduction proxy is disabled by default. 61 // Data reduction proxy is disabled by default.
51 bool AwBrowserContext::data_reduction_proxy_enabled_ = false; 62 bool AwBrowserContext::data_reduction_proxy_enabled_ = false;
52 63
53 AwBrowserContext::AwBrowserContext( 64 AwBrowserContext::AwBrowserContext(
54 const FilePath path, 65 const FilePath path,
55 JniDependencyFactory* native_factory) 66 JniDependencyFactory* native_factory)
56 : context_storage_path_(path), 67 : context_storage_path_(path),
57 native_factory_(native_factory) { 68 native_factory_(native_factory) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 void AwBrowserContext::PreMainMessageLoopRun() { 116 void AwBrowserContext::PreMainMessageLoopRun() {
106 cookie_store_ = CreateCookieStore(this); 117 cookie_store_ = CreateCookieStore(this);
107 data_reduction_proxy_settings_.reset( 118 data_reduction_proxy_settings_.reset(
108 new DataReductionProxySettings( 119 new DataReductionProxySettings(
109 new data_reduction_proxy::DataReductionProxyParams( 120 new data_reduction_proxy::DataReductionProxyParams(
110 data_reduction_proxy::DataReductionProxyParams::kAllowed))); 121 data_reduction_proxy::DataReductionProxyParams::kAllowed)));
111 scoped_ptr<DataReductionProxyConfigService> 122 scoped_ptr<DataReductionProxyConfigService>
112 data_reduction_proxy_config_service( 123 data_reduction_proxy_config_service(
113 new DataReductionProxyConfigService( 124 new DataReductionProxyConfigService(
114 scoped_ptr<net::ProxyConfigService>( 125 scoped_ptr<net::ProxyConfigService>(
115 net::ProxyService::CreateSystemProxyConfigService( 126 CreateProxyConfigService()).Pass()));
116 BrowserThread::GetMessageLoopProxyForThread(
117 BrowserThread::IO),
118 NULL /* Ignored on Android */)).Pass()));
119 if (data_reduction_proxy_settings_.get()) { 127 if (data_reduction_proxy_settings_.get()) {
120 data_reduction_proxy_configurator_.reset( 128 data_reduction_proxy_configurator_.reset(
121 new data_reduction_proxy::DataReductionProxyConfigTracker( 129 new data_reduction_proxy::DataReductionProxyConfigTracker(
122 base::Bind(&DataReductionProxyConfigService::UpdateProxyConfig, 130 base::Bind(&DataReductionProxyConfigService::UpdateProxyConfig,
123 base::Unretained( 131 base::Unretained(
124 data_reduction_proxy_config_service.get())), 132 data_reduction_proxy_config_service.get())),
125 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); 133 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
126 data_reduction_proxy_settings_->SetProxyConfigurator( 134 data_reduction_proxy_settings_->SetProxyConfigurator(
127 data_reduction_proxy_configurator_.get()); 135 data_reduction_proxy_configurator_.get());
128 } 136 }
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 data_reduction_proxy_statistics_ = 321 data_reduction_proxy_statistics_ =
314 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs>( 322 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs>(
315 new data_reduction_proxy::DataReductionProxyStatisticsPrefs( 323 new data_reduction_proxy::DataReductionProxyStatisticsPrefs(
316 user_pref_service_.get(), 324 user_pref_service_.get(),
317 base::MessageLoopProxy::current(), 325 base::MessageLoopProxy::current(),
318 commit_delay)); 326 commit_delay));
319 } 327 }
320 } 328 }
321 329
322 } // namespace android_webview 330 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/net/aw_url_request_context_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698