diff options
Diffstat (limited to 'android_webview/browser')
-rw-r--r-- | android_webview/browser/aw_browser_context.cc | 37 | ||||
-rw-r--r-- | android_webview/browser/net/aw_url_request_context_getter.cc | 24 |
2 files changed, 25 insertions, 36 deletions
diff --git a/android_webview/browser/aw_browser_context.cc b/android_webview/browser/aw_browser_context.cc index 05f68e3..c6c020c 100644 --- a/android_webview/browser/aw_browser_context.cc +++ b/android_webview/browser/aw_browser_context.cc @@ -16,7 +16,6 @@ #include "base/prefs/pref_service_factory.h" #include "components/autofill/core/common/autofill_pref_names.h" #include "components/data_reduction_proxy/browser/data_reduction_proxy_config_service.h" -#include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h" #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.h" #include "components/user_prefs/user_prefs.h" @@ -95,23 +94,21 @@ void AwBrowserContext::SetDataReductionProxyEnabled(bool enabled) { void AwBrowserContext::PreMainMessageLoopRun() { cookie_store_ = CreateCookieStore(this); -#if defined(SPDY_PROXY_AUTH_ORIGIN) + DataReductionProxySettings::SetAllowed(true); + DataReductionProxySettings::SetPromoAllowed(false); data_reduction_proxy_settings_.reset( - new DataReductionProxySettings( - new data_reduction_proxy::DataReductionProxyParams( - data_reduction_proxy::DataReductionProxyParams::kAllowed))); -#endif + new DataReductionProxySettings()); + data_reduction_proxy_settings_->set_fallback_allowed(false); url_request_context_getter_ = new AwURLRequestContextGetter(GetPath(), cookie_store_.get()); - if (data_reduction_proxy_settings_.get()) { - scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator> - configurator(new data_reduction_proxy::DataReductionProxyConfigTracker( - url_request_context_getter_->proxy_config_service(), - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); - data_reduction_proxy_settings_->SetProxyConfigurator(configurator.Pass()); - } + scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator> + configurator(new data_reduction_proxy::DataReductionProxyConfigTracker( + url_request_context_getter_->proxy_config_service(), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); + data_reduction_proxy_settings_->SetProxyConfigurator(configurator.Pass()); + visitedlink_master_.reset( new visitedlink::VisitedLinkMaster(this, this, false)); visitedlink_master_->Init(); @@ -186,15 +183,13 @@ void AwBrowserContext::CreateUserPrefServiceIfNecessary() { user_prefs::UserPrefs::Set(this, user_pref_service_.get()); - if (data_reduction_proxy_settings_.get()) { - data_reduction_proxy_settings_->InitDataReductionProxySettings( - user_pref_service_.get(), - user_pref_service_.get(), - GetRequestContext()); + data_reduction_proxy_settings_->InitDataReductionProxySettings( + user_pref_service_.get(), + user_pref_service_.get(), + GetRequestContext()); - data_reduction_proxy_settings_->SetDataReductionProxyEnabled( - data_reduction_proxy_enabled_); - } + data_reduction_proxy_settings_->SetDataReductionProxyEnabled( + data_reduction_proxy_enabled_); } base::FilePath AwBrowserContext::GetPath() const { diff --git a/android_webview/browser/net/aw_url_request_context_getter.cc b/android_webview/browser/net/aw_url_request_context_getter.cc index 9ed9e7e..218f09a 100644 --- a/android_webview/browser/net/aw_url_request_context_getter.cc +++ b/android_webview/browser/net/aw_url_request_context_getter.cc @@ -200,14 +200,11 @@ void AwURLRequestContextGetter::InitializeURLRequestContext() { AwContentBrowserClient::GetAcceptLangsImpl())); ApplyCmdlineOverridesToURLRequestContextBuilder(&builder); -#if defined(SPDY_PROXY_AUTH_ORIGIN) - data_reduction_proxy::DataReductionProxyParams drp_params( - data_reduction_proxy::DataReductionProxyParams::kAllowed); + builder.add_http_auth_handler_factory( data_reduction_proxy::HttpAuthHandlerDataReductionProxy::Scheme(), new data_reduction_proxy::HttpAuthHandlerDataReductionProxy::Factory( - drp_params.GetAllowedProxies())); -#endif + DataReductionProxySettings::GetDataReductionProxies())); url_request_context_.reset(builder.Build()); // TODO(mnaganov): Fix URLRequestContextBuilder to use proper threads. @@ -225,21 +222,18 @@ void AwURLRequestContextGetter::InitializeURLRequestContext() { 20 * 1024 * 1024, // 20M BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE))); -#if defined(SPDY_PROXY_AUTH_ORIGIN) AwBrowserContext* browser_context = AwBrowserContext::GetDefault(); DCHECK(browser_context); DataReductionProxySettings* drp_settings = browser_context->GetDataReductionProxySettings(); - if (drp_settings) { - std::string drp_key = drp_settings->params()->key(); - // Only precache credentials if a key is available at URLRequestContext - // initialization. - if (!drp_key.empty()) { - DataReductionProxySettings::InitDataReductionProxySession( - main_cache->GetSession(), &drp_params); - } + DCHECK(drp_settings); + std::string drp_key = drp_settings->key(); + // Only precache credentials if a key is available at URLRequestContext + // initialization. + if (!drp_key.empty()) { + DataReductionProxySettings::InitDataReductionProxySession( + main_cache->GetSession(), drp_settings->key()); } -#endif main_http_factory_.reset(main_cache); url_request_context_->set_http_transaction_factory(main_cache); |