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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 412143009: Moved data reduction proxy initialization logic to ProfileImplIOData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from willchan and sgurun Created 6 years, 4 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 "chrome/browser/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 28 matching lines...) Expand all
39 #include "chrome/browser/domain_reliability/service_factory.h" 39 #include "chrome/browser/domain_reliability/service_factory.h"
40 #include "chrome/browser/download/chrome_download_manager_delegate.h" 40 #include "chrome/browser/download/chrome_download_manager_delegate.h"
41 #include "chrome/browser/download/download_service.h" 41 #include "chrome/browser/download/download_service.h"
42 #include "chrome/browser/download/download_service_factory.h" 42 #include "chrome/browser/download/download_service_factory.h"
43 #include "chrome/browser/history/top_sites.h" 43 #include "chrome/browser/history/top_sites.h"
44 #include "chrome/browser/net/chrome_url_request_context.h" 44 #include "chrome/browser/net/chrome_url_request_context.h"
45 #include "chrome/browser/net/net_pref_observer.h" 45 #include "chrome/browser/net/net_pref_observer.h"
46 #include "chrome/browser/net/predictor.h" 46 #include "chrome/browser/net/predictor.h"
47 #include "chrome/browser/net/pref_proxy_config_tracker.h" 47 #include "chrome/browser/net/pref_proxy_config_tracker.h"
48 #include "chrome/browser/net/proxy_service_factory.h" 48 #include "chrome/browser/net/proxy_service_factory.h"
49 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
49 #include "chrome/browser/net/ssl_config_service_manager.h" 50 #include "chrome/browser/net/ssl_config_service_manager.h"
50 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" 51 #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
51 #include "chrome/browser/plugins/plugin_prefs.h" 52 #include "chrome/browser/plugins/plugin_prefs.h"
52 #include "chrome/browser/policy/profile_policy_connector.h" 53 #include "chrome/browser/policy/profile_policy_connector.h"
53 #include "chrome/browser/policy/profile_policy_connector_factory.h" 54 #include "chrome/browser/policy/profile_policy_connector_factory.h"
54 #include "chrome/browser/prefs/browser_prefs.h" 55 #include "chrome/browser/prefs/browser_prefs.h"
55 #include "chrome/browser/prefs/chrome_pref_service_factory.h" 56 #include "chrome/browser/prefs/chrome_pref_service_factory.h"
56 #include "chrome/browser/prefs/pref_service_syncable.h" 57 #include "chrome/browser/prefs/pref_service_syncable.h"
57 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" 58 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h"
58 #include "chrome/browser/prerender/prerender_manager_factory.h" 59 #include "chrome/browser/prerender/prerender_manager_factory.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 #include "chrome/browser/media/protected_media_identifier_permission_context_fac tory.h" 105 #include "chrome/browser/media/protected_media_identifier_permission_context_fac tory.h"
105 #endif 106 #endif
106 107
107 #if defined(OS_CHROMEOS) 108 #if defined(OS_CHROMEOS)
108 #include "chrome/browser/chromeos/locale_change_guard.h" 109 #include "chrome/browser/chromeos/locale_change_guard.h"
109 #include "chrome/browser/chromeos/login/users/user_manager.h" 110 #include "chrome/browser/chromeos/login/users/user_manager.h"
110 #include "chrome/browser/chromeos/preferences.h" 111 #include "chrome/browser/chromeos/preferences.h"
111 #include "chrome/browser/chromeos/profiles/profile_helper.h" 112 #include "chrome/browser/chromeos/profiles/profile_helper.h"
112 #endif 113 #endif
113 114
115 #if defined(SPDY_PROXY_AUTH_ORIGIN)
116 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator. h"
117 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h"
118 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
119 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h"
120 #endif
121
114 #if defined(ENABLE_CONFIGURATION_POLICY) 122 #if defined(ENABLE_CONFIGURATION_POLICY)
115 #include "chrome/browser/policy/schema_registry_service.h" 123 #include "chrome/browser/policy/schema_registry_service.h"
116 #include "chrome/browser/policy/schema_registry_service_factory.h" 124 #include "chrome/browser/policy/schema_registry_service_factory.h"
117 #include "components/policy/core/browser/browser_policy_connector.h" 125 #include "components/policy/core/browser/browser_policy_connector.h"
118 #if defined(OS_CHROMEOS) 126 #if defined(OS_CHROMEOS)
119 #include "chrome/browser/chromeos/login/login_utils.h" 127 #include "chrome/browser/chromeos/login/login_utils.h"
120 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" 128 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
121 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom eos.h" 129 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom eos.h"
122 #else 130 #else
123 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" 131 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h"
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 #endif 608 #endif
601 content::CookieStoreConfig::SessionCookieMode session_cookie_mode = 609 content::CookieStoreConfig::SessionCookieMode session_cookie_mode =
602 content::CookieStoreConfig::PERSISTANT_SESSION_COOKIES; 610 content::CookieStoreConfig::PERSISTANT_SESSION_COOKIES;
603 if (GetLastSessionExitType() == Profile::EXIT_CRASHED || 611 if (GetLastSessionExitType() == Profile::EXIT_CRASHED ||
604 startup_pref_type == SessionStartupPref::LAST) { 612 startup_pref_type == SessionStartupPref::LAST) {
605 session_cookie_mode = content::CookieStoreConfig::RESTORED_SESSION_COOKIES; 613 session_cookie_mode = content::CookieStoreConfig::RESTORED_SESSION_COOKIES;
606 } 614 }
607 615
608 InitHostZoomMap(); 616 InitHostZoomMap();
609 617
618 base::Callback<void(bool)> data_reduction_proxy_unavailable;
619 scoped_ptr<data_reduction_proxy::DataReductionProxyParams>
620 data_reduction_proxy_params;
621 #if defined(SPDY_PROXY_AUTH_ORIGIN)
622 DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings =
623 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this);
624 data_reduction_proxy_params =
625 data_reduction_proxy_chrome_settings->params()->Clone();
626 data_reduction_proxy_unavailable =
627 base::Bind(
628 &data_reduction_proxy::DataReductionProxySettings::SetUnreachable,
629 base::Unretained(data_reduction_proxy_chrome_settings));
630 #endif
631
610 // Make sure we initialize the ProfileIOData after everything else has been 632 // Make sure we initialize the ProfileIOData after everything else has been
611 // initialized that we might be reading from the IO thread. 633 // initialized that we might be reading from the IO thread.
612 634
613 io_data_.Init(cookie_path, channel_id_path, cache_path, 635 io_data_.Init(cookie_path, channel_id_path, cache_path,
614 cache_max_size, media_cache_path, media_cache_max_size, 636 cache_max_size, media_cache_path, media_cache_max_size,
615 extensions_cookie_path, GetPath(), infinite_cache_path, 637 extensions_cookie_path, GetPath(), infinite_cache_path,
616 predictor_, session_cookie_mode, GetSpecialStoragePolicy(), 638 predictor_, session_cookie_mode, GetSpecialStoragePolicy(),
617 CreateDomainReliabilityMonitor()); 639 CreateDomainReliabilityMonitor(),
640 data_reduction_proxy_unavailable,
641 data_reduction_proxy_params.Pass());
642
643 #if defined(SPDY_PROXY_AUTH_ORIGIN)
644 scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator>
645 configurator(new DataReductionProxyChromeConfigurator(prefs_.get()));
646 data_reduction_proxy_chrome_settings->InitDataReductionProxySettings(
647 configurator.Pass(),
648 prefs_.get(),
649 g_browser_process->local_state(),
650 GetRequestContext());
651 #endif
618 652
619 #if defined(ENABLE_PLUGINS) 653 #if defined(ENABLE_PLUGINS)
620 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( 654 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext(
621 PluginPrefs::GetForProfile(this).get(), 655 PluginPrefs::GetForProfile(this).get(),
622 io_data_.GetResourceContextNoInit()); 656 io_data_.GetResourceContextNoInit());
623 #endif 657 #endif
624 658
625 // Delay README creation to not impact startup performance. 659 // Delay README creation to not impact startup performance.
626 BrowserThread::PostDelayedTask( 660 BrowserThread::PostDelayedTask(
627 BrowserThread::FILE, FROM_HERE, 661 BrowserThread::FILE, FROM_HERE,
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 ProfileImpl::CreateDomainReliabilityMonitor() { 1374 ProfileImpl::CreateDomainReliabilityMonitor() {
1341 domain_reliability::DomainReliabilityService* service = 1375 domain_reliability::DomainReliabilityService* service =
1342 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> 1376 domain_reliability::DomainReliabilityServiceFactory::GetInstance()->
1343 GetForBrowserContext(this); 1377 GetForBrowserContext(this);
1344 if (!service) 1378 if (!service)
1345 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); 1379 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>();
1346 1380
1347 return service->CreateMonitor( 1381 return service->CreateMonitor(
1348 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 1382 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
1349 } 1383 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698