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

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 734263003: Move data reduction proxy logic out of chrome and android webview network delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing mmenke and jochen comments Created 6 years 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
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()) {
bengr 2014/12/02 17:20:00 When would provide be NULL?
megjablon 2014/12/02 22:33:21 Removed in moved code
+ 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(
bengr 2014/12/02 17:20:00 Again, this Init needs to be rewritten.
megjablon 2014/12/02 22:33:21 Removed.
+ profile_prefs, ui_thread_proxy, NULL, NULL, NULL, NULL, NULL,
bengr 2014/12/02 17:20:00 This confuses me. You always instantiate the DRPNe
megjablon 2014/12/02 22:33:21 Moved into ProfileImplIOData as discussed.
+ 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(

Powered by Google App Engine
This is Rietveld 408576698