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

Side by Side 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: Created 6 years, 1 month 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 "chrome/browser/profiles/profile_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "chrome/browser/profiles/profile_manager.h" 48 #include "chrome/browser/profiles/profile_manager.h"
49 #include "chrome/browser/signin/signin_names_io_thread.h" 49 #include "chrome/browser/signin/signin_names_io_thread.h"
50 #include "chrome/common/chrome_paths.h" 50 #include "chrome/common/chrome_paths.h"
51 #include "chrome/common/chrome_switches.h" 51 #include "chrome/common/chrome_switches.h"
52 #include "chrome/common/pref_names.h" 52 #include "chrome/common/pref_names.h"
53 #include "chrome/common/url_constants.h" 53 #include "chrome/common/url_constants.h"
54 #include "components/content_settings/core/browser/content_settings_provider.h" 54 #include "components/content_settings/core/browser/content_settings_provider.h"
55 #include "components/content_settings/core/browser/host_content_settings_map.h" 55 #include "components/content_settings/core/browser/host_content_settings_map.h"
56 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig_service.h" 56 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig_service.h"
57 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf igurator.h" 57 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf igurator.h"
58 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw ork_delegate.h"
58 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" 59 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h"
59 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc hes.h" 60 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc hes.h"
60 #include "components/dom_distiller/core/url_constants.h" 61 #include "components/dom_distiller/core/url_constants.h"
61 #include "components/startup_metric_utils/startup_metric_utils.h" 62 #include "components/startup_metric_utils/startup_metric_utils.h"
62 #include "components/sync_driver/pref_names.h" 63 #include "components/sync_driver/pref_names.h"
63 #include "components/url_fixer/url_fixer.h" 64 #include "components/url_fixer/url_fixer.h"
64 #include "content/public/browser/browser_thread.h" 65 #include "content/public/browser/browser_thread.h"
65 #include "content/public/browser/host_zoom_map.h" 66 #include "content/public/browser/host_zoom_map.h"
66 #include "content/public/browser/notification_service.h" 67 #include "content/public/browser/notification_service.h"
67 #include "content/public/browser/resource_context.h" 68 #include "content/public/browser/resource_context.h"
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 CHECK(profile_params_.get()); 1000 CHECK(profile_params_.get());
1000 1001
1001 IOThread* const io_thread = profile_params_->io_thread; 1002 IOThread* const io_thread = profile_params_->io_thread;
1002 IOThread::Globals* const io_thread_globals = io_thread->globals(); 1003 IOThread::Globals* const io_thread_globals = io_thread->globals();
1003 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 1004 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
1004 1005
1005 // Create the common request contexts. 1006 // Create the common request contexts.
1006 main_request_context_.reset(new net::URLRequestContext()); 1007 main_request_context_.reset(new net::URLRequestContext());
1007 extensions_request_context_.reset(new net::URLRequestContext()); 1008 extensions_request_context_.reset(new net::URLRequestContext());
1008 1009
1009 ChromeNetworkDelegate* network_delegate = 1010 scoped_ptr<ChromeNetworkDelegate> network_delegate =
1010 new ChromeNetworkDelegate( 1011 scoped_ptr<ChromeNetworkDelegate>(new ChromeNetworkDelegate(
1011 #if defined(ENABLE_EXTENSIONS) 1012 #if defined(ENABLE_EXTENSIONS)
1012 io_thread_globals->extension_event_router_forwarder.get(), 1013 io_thread_globals->extension_event_router_forwarder.get(),
1013 #else 1014 #else
1014 NULL, 1015 NULL,
1015 #endif 1016 #endif
1016 &enable_referrers_); 1017 &enable_referrers_));
1017 if (command_line.HasSwitch(switches::kEnableClientHints)) 1018 if (command_line.HasSwitch(switches::kEnableClientHints))
1018 network_delegate->SetEnableClientHints(); 1019 network_delegate->SetEnableClientHints();
1019 #if defined(ENABLE_EXTENSIONS) 1020 #if defined(ENABLE_EXTENSIONS)
1020 network_delegate->set_extension_info_map( 1021 network_delegate->set_extension_info_map(
1021 profile_params_->extension_info_map.get()); 1022 profile_params_->extension_info_map.get());
1022 #endif 1023 #endif
1023 #if defined(ENABLE_CONFIGURATION_POLICY) 1024 #if defined(ENABLE_CONFIGURATION_POLICY)
1024 network_delegate->set_url_blacklist_manager(url_blacklist_manager_.get()); 1025 network_delegate->set_url_blacklist_manager(url_blacklist_manager_.get());
1025 #endif 1026 #endif
1026 network_delegate->set_profile(profile_params_->profile); 1027 network_delegate->set_profile(profile_params_->profile);
1027 network_delegate->set_profile_path(profile_params_->path); 1028 network_delegate->set_profile_path(profile_params_->path);
1028 network_delegate->set_cookie_settings(profile_params_->cookie_settings.get()); 1029 network_delegate->set_cookie_settings(profile_params_->cookie_settings.get());
1029 network_delegate->set_enable_do_not_track(&enable_do_not_track_); 1030 network_delegate->set_enable_do_not_track(&enable_do_not_track_);
1030 network_delegate->set_force_google_safe_search(&force_safesearch_); 1031 network_delegate->set_force_google_safe_search(&force_safesearch_);
1031 network_delegate->set_prerender_tracker(profile_params_->prerender_tracker); 1032 network_delegate->set_prerender_tracker(profile_params_->prerender_tracker);
1032 network_delegate_.reset(network_delegate); 1033 chrome_network_delegate_ = network_delegate.get();
1034 data_reduction_proxy::DataReductionProxyNetworkDelegate*
1035 data_reduction_proxy_network_delegate =
1036 new data_reduction_proxy::DataReductionProxyNetworkDelegate(
1037 network_delegate.Pass());
1038 Profile* profile = reinterpret_cast<Profile*>(profile_params_->profile);
1039 // Ignore off-the-record data.
1040 if (profile && !profile->IsOffTheRecord()) {
1041 data_reduction_proxy_network_delegate->set_profile_prefs(
1042 profile->GetPrefs());
bengr 2014/11/18 19:30:55 The DRPND constructor should take the pref service
megjablon 2014/11/19 19:23:40 Done.
1043 data_reduction_proxy_network_delegate->set_ui_thread_proxy(
1044 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI));
1045 }
1046 data_reduction_proxy_network_delegate_.reset(
1047 data_reduction_proxy_network_delegate);
1033 1048
1034 fraudulent_certificate_reporter_.reset( 1049 fraudulent_certificate_reporter_.reset(
1035 new chrome_browser_net::ChromeFraudulentCertificateReporter( 1050 new chrome_browser_net::ChromeFraudulentCertificateReporter(
1036 main_request_context_.get())); 1051 main_request_context_.get()));
1037 1052
1038 // NOTE: Proxy service uses the default io thread network delegate, not the 1053 // NOTE: Proxy service uses the default io thread network delegate, not the
1039 // delegate just created. 1054 // delegate just created.
1040 proxy_service_.reset( 1055 proxy_service_.reset(
1041 ProxyServiceFactory::CreateProxyService( 1056 ProxyServiceFactory::CreateProxyService(
1042 io_thread->net_log(), 1057 io_thread->net_log(),
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 void ProfileIOData::SetCookieSettingsForTesting( 1303 void ProfileIOData::SetCookieSettingsForTesting(
1289 CookieSettings* cookie_settings) { 1304 CookieSettings* cookie_settings) {
1290 DCHECK(!cookie_settings_.get()); 1305 DCHECK(!cookie_settings_.get());
1291 cookie_settings_ = cookie_settings; 1306 cookie_settings_ = cookie_settings;
1292 } 1307 }
1293 1308
1294 void ProfileIOData::set_signin_names_for_testing( 1309 void ProfileIOData::set_signin_names_for_testing(
1295 SigninNamesOnIOThread* signin_names) { 1310 SigninNamesOnIOThread* signin_names) {
1296 signin_names_.reset(signin_names); 1311 signin_names_.reset(signin_names);
1297 } 1312 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698