diff options
author | jeremyim <jeremyim@chromium.org> | 2014-11-24 13:31:13 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-24 21:31:56 +0000 |
commit | e82faa1ec0e96751da4db1d0f0df9bf83af465f1 (patch) | |
tree | 2354664d28f24197e44e57686510fca1d70c7a69 /android_webview | |
parent | c50e90e50d4d105f0d2260385a2090d9108c9fa3 (diff) | |
download | chromium_src-e82faa1ec0e96751da4db1d0f0df9bf83af465f1.zip chromium_src-e82faa1ec0e96751da4db1d0f0df9bf83af465f1.tar.gz chromium_src-e82faa1ec0e96751da4db1d0f0df9bf83af465f1.tar.bz2 |
Add net_log events for data reduction proxy conditions. They will be exposed in the #bandwidth net-internals tab in a future CL.
BUG=346356
Review URL: https://codereview.chromium.org/719373002
Cr-Commit-Position: refs/heads/master@{#305496}
Diffstat (limited to 'android_webview')
-rw-r--r-- | android_webview/browser/aw_browser_context.cc | 14 | ||||
-rw-r--r-- | android_webview/browser/aw_browser_context.h | 6 | ||||
-rw-r--r-- | android_webview/browser/net/aw_url_request_context_getter.cc | 3 |
3 files changed, 21 insertions, 2 deletions
diff --git a/android_webview/browser/aw_browser_context.cc b/android_webview/browser/aw_browser_context.cc index 4175b3f..25f91fc 100644 --- a/android_webview/browser/aw_browser_context.cc +++ b/android_webview/browser/aw_browser_context.cc @@ -22,6 +22,7 @@ #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_prefs.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_statistics_prefs.h" +#include "components/data_reduction_proxy/core/common/data_reduction_proxy_event_store.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h" #include "components/user_prefs/user_prefs.h" #include "components/visitedlink/browser/visitedlink_master.h" @@ -36,6 +37,7 @@ using base::FilePath; using content::BrowserThread; using data_reduction_proxy::DataReductionProxyConfigService; +using data_reduction_proxy::DataReductionProxyEventStore; using data_reduction_proxy::DataReductionProxySettings; namespace android_webview { @@ -137,6 +139,9 @@ void AwBrowserContext::PreMainMessageLoopRun() { new DataReductionProxySettings( new data_reduction_proxy::DataReductionProxyParams( data_reduction_proxy::DataReductionProxyParams::kAllowed))); + data_reduction_proxy_event_store_.reset( + new DataReductionProxyEventStore( + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); scoped_ptr<DataReductionProxyConfigService> data_reduction_proxy_config_service( new DataReductionProxyConfigService( @@ -226,6 +231,11 @@ DataReductionProxySettings* AwBrowserContext::GetDataReductionProxySettings() { return data_reduction_proxy_settings_.get(); } +DataReductionProxyEventStore* + AwBrowserContext::GetDataReductionProxyEventStore() { + return data_reduction_proxy_event_store_.get(); +} + AwURLRequestContextGetter* AwBrowserContext::GetAwURLRequestContext() { return url_request_context_getter_.get(); } @@ -257,7 +267,9 @@ void AwBrowserContext::CreateUserPrefServiceIfNecessary() { if (data_reduction_proxy_settings_.get()) { data_reduction_proxy_settings_->InitDataReductionProxySettings( user_pref_service_.get(), - GetRequestContext()); + GetRequestContext(), + GetAwURLRequestContext()->GetNetLog(), + GetDataReductionProxyEventStore()); data_reduction_proxy_settings_->MaybeActivateDataReductionProxy(true); SetDataReductionProxyEnabled(data_reduction_proxy_enabled_); diff --git a/android_webview/browser/aw_browser_context.h b/android_webview/browser/aw_browser_context.h index 0fc8e83..3aed295 100644 --- a/android_webview/browser/aw_browser_context.h +++ b/android_webview/browser/aw_browser_context.h @@ -29,6 +29,7 @@ class WebContents; namespace data_reduction_proxy { class DataReductionProxyConfigurator; +class DataReductionProxyEventStore; class DataReductionProxySettings; class DataReductionProxyStatisticsPrefs; } @@ -89,6 +90,9 @@ class AwBrowserContext : public content::BrowserContext, data_reduction_proxy::DataReductionProxySettings* GetDataReductionProxySettings(); + data_reduction_proxy::DataReductionProxyEventStore* + GetDataReductionProxyEventStore(); + AwURLRequestContextGetter* GetAwURLRequestContext(); void CreateUserPrefServiceIfNecessary(); @@ -149,6 +153,8 @@ class AwBrowserContext : public content::BrowserContext, data_reduction_proxy_statistics_; scoped_ptr<data_reduction_proxy::DataReductionProxySettings> data_reduction_proxy_settings_; + scoped_ptr<data_reduction_proxy::DataReductionProxyEventStore> + data_reduction_proxy_event_store_; DISALLOW_COPY_AND_ASSIGN(AwBrowserContext); }; 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 b600a46..ce39602 100644 --- a/android_webview/browser/net/aw_url_request_context_getter.cc +++ b/android_webview/browser/net/aw_url_request_context_getter.cc @@ -259,7 +259,8 @@ void AwURLRequestContextGetter::InitializeURLRequestContext() { job_factory_.reset(new net::URLRequestInterceptingJobFactory( job_factory_.Pass(), make_scoped_ptr( new data_reduction_proxy::DataReductionProxyInterceptor( - data_reduction_proxy_settings->params(), NULL)))); + data_reduction_proxy_settings->params(), NULL, + browser_context->GetDataReductionProxyEventStore())))); url_request_context_->set_job_factory(job_factory_.get()); } |