| Index: chrome/browser/profiles/profile_io_data.cc
|
| diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
|
| index 72e8d9222036d6f035993e5cb8fcda8be3ddcf78..9d185915345f097eab4eca323497d418de87ebc0 100644
|
| --- a/chrome/browser/profiles/profile_io_data.cc
|
| +++ b/chrome/browser/profiles/profile_io_data.cc
|
| @@ -55,6 +55,7 @@
|
| #include "components/content_settings/core/browser/host_content_settings_map.h"
|
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service.h"
|
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator.h"
|
| +#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h"
|
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h"
|
| #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h"
|
| #include "components/dom_distiller/core/url_constants.h"
|
| @@ -1006,14 +1007,14 @@ void ProfileIOData::Init(
|
| main_request_context_.reset(new net::URLRequestContext());
|
| extensions_request_context_.reset(new net::URLRequestContext());
|
|
|
| - ChromeNetworkDelegate* network_delegate =
|
| - new ChromeNetworkDelegate(
|
| + scoped_ptr<ChromeNetworkDelegate> network_delegate =
|
| + scoped_ptr<ChromeNetworkDelegate>(new ChromeNetworkDelegate(
|
| #if defined(ENABLE_EXTENSIONS)
|
| io_thread_globals->extension_event_router_forwarder.get(),
|
| #else
|
| NULL,
|
| #endif
|
| - &enable_referrers_);
|
| + &enable_referrers_));
|
| if (command_line.HasSwitch(switches::kEnableClientHints))
|
| network_delegate->SetEnableClientHints();
|
| #if defined(ENABLE_EXTENSIONS)
|
| @@ -1029,7 +1030,28 @@ void ProfileIOData::Init(
|
| network_delegate->set_enable_do_not_track(&enable_do_not_track_);
|
| network_delegate->set_force_google_safe_search(&force_safesearch_);
|
| network_delegate->set_prerender_tracker(profile_params_->prerender_tracker);
|
| - network_delegate_.reset(network_delegate);
|
| + chrome_network_delegate_ = network_delegate.get();
|
| + Profile* profile = reinterpret_cast<Profile*>(profile_params_->profile);
|
| + // Ignore off-the-record data.
|
| + PrefService* profile_prefs = NULL;
|
| + scoped_refptr<base::MessageLoopProxy> ui_thread_proxy;
|
| + if (profile && !profile->IsOffTheRecord()) {
|
| + profile_prefs = profile->GetPrefs();
|
| + ui_thread_proxy =
|
| + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI);
|
| + }
|
| + data_reduction_proxy::DataReductionProxyNetworkDelegate*
|
| + data_reduction_proxy_network_delegate =
|
| + new data_reduction_proxy::DataReductionProxyNetworkDelegate(
|
| + network_delegate.Pass());
|
| + data_reduction_proxy_network_delegate->Init(
|
| + profile_prefs, ui_thread_proxy, NULL, NULL, NULL, NULL, NULL,
|
| + data_reduction_proxy::DataReductionProxyNetworkDelegate::
|
| + OnResolveProxyHandler(),
|
| + data_reduction_proxy::DataReductionProxyNetworkDelegate::
|
| + ProxyConfigGetter());
|
| + data_reduction_proxy_network_delegate_.reset(
|
| + data_reduction_proxy_network_delegate);
|
|
|
| fraudulent_certificate_reporter_.reset(
|
| new chrome_browser_net::ChromeFraudulentCertificateReporter(
|
|
|