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

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

Issue 473723002: Update data reduction proxy statistics prefs less often on desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tooManyWritesPatch
Patch Set: Removing statistics prefs from Android WebView 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 unified diff | Download patch
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 proxy_settings->SetDataReductionProxyEnabled(data_reduction_proxy_enabled_); 97 proxy_settings->SetDataReductionProxyEnabled(data_reduction_proxy_enabled_);
98 } 98 }
99 99
100 void AwBrowserContext::PreMainMessageLoopRun() { 100 void AwBrowserContext::PreMainMessageLoopRun() {
101 cookie_store_ = CreateCookieStore(this); 101 cookie_store_ = CreateCookieStore(this);
102 #if defined(SPDY_PROXY_AUTH_ORIGIN) 102 #if defined(SPDY_PROXY_AUTH_ORIGIN)
103 data_reduction_proxy_settings_.reset( 103 data_reduction_proxy_settings_.reset(
104 new DataReductionProxySettings( 104 new DataReductionProxySettings(
105 new data_reduction_proxy::DataReductionProxyParams( 105 new data_reduction_proxy::DataReductionProxyParams(
106 data_reduction_proxy::DataReductionProxyParams::kAllowed))); 106 data_reduction_proxy::DataReductionProxyParams::kAllowed)));
107 // Unlike in Chrome, DataReductionProxyStatistisPrefs is not instantiated
bengr 2014/09/04 21:18:21 I would change this comment to: // Compression st
megjablon 2014/09/05 20:56:38 Done.
108 // for Android WebView and no local DataReductionProxyPrefs are recorded.
107 #endif 109 #endif
108 scoped_ptr<DataReductionProxyConfigService> 110 scoped_ptr<DataReductionProxyConfigService>
109 data_reduction_proxy_config_service( 111 data_reduction_proxy_config_service(
110 new DataReductionProxyConfigService( 112 new DataReductionProxyConfigService(
111 scoped_ptr<net::ProxyConfigService>( 113 scoped_ptr<net::ProxyConfigService>(
112 net::ProxyService::CreateSystemProxyConfigService( 114 net::ProxyService::CreateSystemProxyConfigService(
113 BrowserThread::GetMessageLoopProxyForThread( 115 BrowserThread::GetMessageLoopProxyForThread(
114 BrowserThread::IO), 116 BrowserThread::IO),
115 NULL /* Ignored on Android */)).Pass())); 117 NULL /* Ignored on Android */)).Pass()));
116 if (data_reduction_proxy_settings_.get()) { 118 if (data_reduction_proxy_settings_.get()) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 base::PrefServiceFactory pref_service_factory; 204 base::PrefServiceFactory pref_service_factory;
203 pref_service_factory.set_user_prefs(make_scoped_refptr(new AwPrefStore())); 205 pref_service_factory.set_user_prefs(make_scoped_refptr(new AwPrefStore()));
204 pref_service_factory.set_read_error_callback(base::Bind(&HandleReadError)); 206 pref_service_factory.set_read_error_callback(base::Bind(&HandleReadError));
205 user_pref_service_ = pref_service_factory.Create(pref_registry).Pass(); 207 user_pref_service_ = pref_service_factory.Create(pref_registry).Pass();
206 208
207 user_prefs::UserPrefs::Set(this, user_pref_service_.get()); 209 user_prefs::UserPrefs::Set(this, user_pref_service_.get());
208 210
209 if (data_reduction_proxy_settings_.get()) { 211 if (data_reduction_proxy_settings_.get()) {
210 data_reduction_proxy_settings_->InitDataReductionProxySettings( 212 data_reduction_proxy_settings_->InitDataReductionProxySettings(
211 user_pref_service_.get(), 213 user_pref_service_.get(),
212 user_pref_service_.get(),
213 GetRequestContext()); 214 GetRequestContext());
214 215
215 data_reduction_proxy_settings_->SetDataReductionProxyEnabled( 216 data_reduction_proxy_settings_->SetDataReductionProxyEnabled(
216 data_reduction_proxy_enabled_); 217 data_reduction_proxy_enabled_);
217 } 218 }
218 } 219 }
219 220
220 base::FilePath AwBrowserContext::GetPath() const { 221 base::FilePath AwBrowserContext::GetPath() const {
221 return context_storage_path_; 222 return context_storage_path_;
222 } 223 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 288
288 void AwBrowserContext::RebuildTable( 289 void AwBrowserContext::RebuildTable(
289 const scoped_refptr<URLEnumerator>& enumerator) { 290 const scoped_refptr<URLEnumerator>& enumerator) {
290 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client 291 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client
291 // can change in the lifetime of this WebView and may not yet be set here. 292 // can change in the lifetime of this WebView and may not yet be set here.
292 // Therefore this initialization path is not used. 293 // Therefore this initialization path is not used.
293 enumerator->OnComplete(true); 294 enumerator->OnComplete(true);
294 } 295 }
295 296
296 } // namespace android_webview 297 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/chrome_network_delegate.h » ('j') | chrome/browser/net/chrome_network_delegate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698