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

Unified Diff: android_webview/browser/aw_browser_context.cc

Issue 286013002: Added alternative configuration for the data reduction proxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK fix Created 6 years, 7 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
« no previous file with comments | « no previous file | android_webview/browser/net/aw_url_request_context_getter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/aw_browser_context.cc
diff --git a/android_webview/browser/aw_browser_context.cc b/android_webview/browser/aw_browser_context.cc
index c6c020c5a48f8c25fd8cf3805003cd7e1730bb45..05f68e3856aff0e35015d4d8258ac3744cdd8cac 100644
--- a/android_webview/browser/aw_browser_context.cc
+++ b/android_webview/browser/aw_browser_context.cc
@@ -16,6 +16,7 @@
#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"
@@ -94,21 +95,23 @@ void AwBrowserContext::SetDataReductionProxyEnabled(bool enabled) {
void AwBrowserContext::PreMainMessageLoopRun() {
cookie_store_ = CreateCookieStore(this);
- DataReductionProxySettings::SetAllowed(true);
- DataReductionProxySettings::SetPromoAllowed(false);
+#if defined(SPDY_PROXY_AUTH_ORIGIN)
data_reduction_proxy_settings_.reset(
- new DataReductionProxySettings());
- data_reduction_proxy_settings_->set_fallback_allowed(false);
+ new DataReductionProxySettings(
+ new data_reduction_proxy::DataReductionProxyParams(
+ data_reduction_proxy::DataReductionProxyParams::kAllowed)));
+#endif
url_request_context_getter_ =
new AwURLRequestContextGetter(GetPath(), cookie_store_.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());
-
+ 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());
+ }
visitedlink_master_.reset(
new visitedlink::VisitedLinkMaster(this, this, false));
visitedlink_master_->Init();
@@ -183,13 +186,15 @@ void AwBrowserContext::CreateUserPrefServiceIfNecessary() {
user_prefs::UserPrefs::Set(this, user_pref_service_.get());
- data_reduction_proxy_settings_->InitDataReductionProxySettings(
- user_pref_service_.get(),
- user_pref_service_.get(),
- GetRequestContext());
+ if (data_reduction_proxy_settings_.get()) {
+ 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 {
« 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