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

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: nit 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
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/profiles/profile_impl_io_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 27 matching lines...) Expand all
38 #include "chrome/browser/dom_distiller/lazy_dom_distiller_service.h" 38 #include "chrome/browser/dom_distiller/lazy_dom_distiller_service.h"
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/net_pref_observer.h" 44 #include "chrome/browser/net/net_pref_observer.h"
45 #include "chrome/browser/net/predictor.h" 45 #include "chrome/browser/net/predictor.h"
46 #include "chrome/browser/net/pref_proxy_config_tracker.h" 46 #include "chrome/browser/net/pref_proxy_config_tracker.h"
47 #include "chrome/browser/net/proxy_service_factory.h" 47 #include "chrome/browser/net/proxy_service_factory.h"
48 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
48 #include "chrome/browser/net/ssl_config_service_manager.h" 49 #include "chrome/browser/net/ssl_config_service_manager.h"
49 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" 50 #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
50 #include "chrome/browser/plugins/plugin_prefs.h" 51 #include "chrome/browser/plugins/plugin_prefs.h"
51 #include "chrome/browser/policy/profile_policy_connector.h" 52 #include "chrome/browser/policy/profile_policy_connector.h"
52 #include "chrome/browser/policy/profile_policy_connector_factory.h" 53 #include "chrome/browser/policy/profile_policy_connector_factory.h"
53 #include "chrome/browser/prefs/browser_prefs.h" 54 #include "chrome/browser/prefs/browser_prefs.h"
54 #include "chrome/browser/prefs/chrome_pref_service_factory.h" 55 #include "chrome/browser/prefs/chrome_pref_service_factory.h"
55 #include "chrome/browser/prefs/pref_service_syncable.h" 56 #include "chrome/browser/prefs/pref_service_syncable.h"
56 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" 57 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h"
57 #include "chrome/browser/prerender/prerender_manager_factory.h" 58 #include "chrome/browser/prerender/prerender_manager_factory.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 #include "chrome/browser/media/protected_media_identifier_permission_context_fac tory.h" 107 #include "chrome/browser/media/protected_media_identifier_permission_context_fac tory.h"
107 #endif 108 #endif
108 109
109 #if defined(OS_CHROMEOS) 110 #if defined(OS_CHROMEOS)
110 #include "chrome/browser/chromeos/locale_change_guard.h" 111 #include "chrome/browser/chromeos/locale_change_guard.h"
111 #include "chrome/browser/chromeos/login/users/user_manager.h" 112 #include "chrome/browser/chromeos/login/users/user_manager.h"
112 #include "chrome/browser/chromeos/preferences.h" 113 #include "chrome/browser/chromeos/preferences.h"
113 #include "chrome/browser/chromeos/profiles/profile_helper.h" 114 #include "chrome/browser/chromeos/profiles/profile_helper.h"
114 #endif 115 #endif
115 116
117 #if defined(SPDY_PROXY_AUTH_ORIGIN)
118 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator. h"
119 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h"
120 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
121 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h"
122 #endif
123
116 #if defined(ENABLE_CONFIGURATION_POLICY) 124 #if defined(ENABLE_CONFIGURATION_POLICY)
117 #include "chrome/browser/policy/schema_registry_service.h" 125 #include "chrome/browser/policy/schema_registry_service.h"
118 #include "chrome/browser/policy/schema_registry_service_factory.h" 126 #include "chrome/browser/policy/schema_registry_service_factory.h"
119 #include "components/policy/core/browser/browser_policy_connector.h" 127 #include "components/policy/core/browser/browser_policy_connector.h"
120 #if defined(OS_CHROMEOS) 128 #if defined(OS_CHROMEOS)
121 #include "chrome/browser/chromeos/login/login_utils.h" 129 #include "chrome/browser/chromeos/login/login_utils.h"
122 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" 130 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
123 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom eos.h" 131 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom eos.h"
124 #else 132 #else
125 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" 133 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h"
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 #endif 622 #endif
615 content::CookieStoreConfig::SessionCookieMode session_cookie_mode = 623 content::CookieStoreConfig::SessionCookieMode session_cookie_mode =
616 content::CookieStoreConfig::PERSISTANT_SESSION_COOKIES; 624 content::CookieStoreConfig::PERSISTANT_SESSION_COOKIES;
617 if (GetLastSessionExitType() == Profile::EXIT_CRASHED || 625 if (GetLastSessionExitType() == Profile::EXIT_CRASHED ||
618 startup_pref_type == SessionStartupPref::LAST) { 626 startup_pref_type == SessionStartupPref::LAST) {
619 session_cookie_mode = content::CookieStoreConfig::RESTORED_SESSION_COOKIES; 627 session_cookie_mode = content::CookieStoreConfig::RESTORED_SESSION_COOKIES;
620 } 628 }
621 629
622 InitHostZoomMap(); 630 InitHostZoomMap();
623 631
632 base::Callback<void(bool)> data_reduction_proxy_unavailable;
633 scoped_ptr<data_reduction_proxy::DataReductionProxyParams>
634 data_reduction_proxy_params;
635 #if defined(SPDY_PROXY_AUTH_ORIGIN)
636 DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings =
637 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this);
638 data_reduction_proxy_params =
639 data_reduction_proxy_chrome_settings->params()->Clone();
640 data_reduction_proxy_unavailable =
641 base::Bind(
642 &data_reduction_proxy::DataReductionProxySettings::SetUnreachable,
643 base::Unretained(data_reduction_proxy_chrome_settings));
644 #endif
645
624 // Make sure we initialize the ProfileIOData after everything else has been 646 // Make sure we initialize the ProfileIOData after everything else has been
625 // initialized that we might be reading from the IO thread. 647 // initialized that we might be reading from the IO thread.
626 648
627 io_data_.Init(cookie_path, channel_id_path, cache_path, 649 io_data_.Init(cookie_path, channel_id_path, cache_path,
628 cache_max_size, media_cache_path, media_cache_max_size, 650 cache_max_size, media_cache_path, media_cache_max_size,
629 extensions_cookie_path, GetPath(), infinite_cache_path, 651 extensions_cookie_path, GetPath(), infinite_cache_path,
630 predictor_, session_cookie_mode, GetSpecialStoragePolicy(), 652 predictor_, session_cookie_mode, GetSpecialStoragePolicy(),
631 CreateDomainReliabilityMonitor()); 653 CreateDomainReliabilityMonitor(),
654 data_reduction_proxy_unavailable,
655 data_reduction_proxy_params.Pass());
656
657 #if defined(SPDY_PROXY_AUTH_ORIGIN)
658 scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator>
659 configurator(new DataReductionProxyChromeConfigurator(prefs_.get()));
660 data_reduction_proxy_chrome_settings->InitDataReductionProxySettings(
661 configurator.Pass(),
662 prefs_.get(),
663 g_browser_process->local_state(),
664 GetRequestContext());
665 #endif
632 666
633 #if defined(ENABLE_PLUGINS) 667 #if defined(ENABLE_PLUGINS)
634 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( 668 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext(
635 PluginPrefs::GetForProfile(this).get(), 669 PluginPrefs::GetForProfile(this).get(),
636 io_data_.GetResourceContextNoInit()); 670 io_data_.GetResourceContextNoInit());
637 #endif 671 #endif
638 672
639 // Delay README creation to not impact startup performance. 673 // Delay README creation to not impact startup performance.
640 BrowserThread::PostDelayedTask( 674 BrowserThread::PostDelayedTask(
641 BrowserThread::FILE, FROM_HERE, 675 BrowserThread::FILE, FROM_HERE,
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 ProfileImpl::CreateDomainReliabilityMonitor() { 1401 ProfileImpl::CreateDomainReliabilityMonitor() {
1368 domain_reliability::DomainReliabilityService* service = 1402 domain_reliability::DomainReliabilityService* service =
1369 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> 1403 domain_reliability::DomainReliabilityServiceFactory::GetInstance()->
1370 GetForBrowserContext(this); 1404 GetForBrowserContext(this);
1371 if (!service) 1405 if (!service)
1372 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); 1406 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>();
1373 1407
1374 return service->CreateMonitor( 1408 return service->CreateMonitor(
1375 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 1409 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
1376 } 1410 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/profiles/profile_impl_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698