OLD | NEW |
---|---|
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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 26 matching lines...) Expand all Loading... | |
37 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 37 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
38 #include "chrome/browser/browser_process.h" | 38 #include "chrome/browser/browser_process.h" |
39 #include "chrome/browser/chrome_notification_types.h" | 39 #include "chrome/browser/chrome_notification_types.h" |
40 #include "chrome/browser/content_settings/cookie_settings_factory.h" | 40 #include "chrome/browser/content_settings/cookie_settings_factory.h" |
41 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 41 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
42 #include "chrome/browser/dom_distiller/profile_utils.h" | 42 #include "chrome/browser/dom_distiller/profile_utils.h" |
43 #include "chrome/browser/domain_reliability/service_factory.h" | 43 #include "chrome/browser/domain_reliability/service_factory.h" |
44 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 44 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
45 #include "chrome/browser/download/download_service.h" | 45 #include "chrome/browser/download/download_service.h" |
46 #include "chrome/browser/download/download_service_factory.h" | 46 #include "chrome/browser/download/download_service_factory.h" |
47 #include "chrome/browser/net/net_pref_observer.h" | |
47 #include "chrome/browser/net/predictor.h" | 48 #include "chrome/browser/net/predictor.h" |
48 #include "chrome/browser/net/proxy_service_factory.h" | 49 #include "chrome/browser/net/proxy_service_factory.h" |
49 #include "chrome/browser/permissions/permission_manager.h" | 50 #include "chrome/browser/permissions/permission_manager.h" |
50 #include "chrome/browser/permissions/permission_manager_factory.h" | 51 #include "chrome/browser/permissions/permission_manager_factory.h" |
51 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 52 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
52 #include "chrome/browser/plugins/plugin_prefs.h" | 53 #include "chrome/browser/plugins/plugin_prefs.h" |
53 #include "chrome/browser/policy/profile_policy_connector.h" | 54 #include "chrome/browser/policy/profile_policy_connector.h" |
54 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 55 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
55 #include "chrome/browser/policy/schema_registry_service.h" | 56 #include "chrome/browser/policy/schema_registry_service.h" |
56 #include "chrome/browser/policy/schema_registry_service_factory.h" | 57 #include "chrome/browser/policy/schema_registry_service_factory.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 #include "content/public/browser/browser_thread.h" | 109 #include "content/public/browser/browser_thread.h" |
109 #include "content/public/browser/dom_storage_context.h" | 110 #include "content/public/browser/dom_storage_context.h" |
110 #include "content/public/browser/notification_service.h" | 111 #include "content/public/browser/notification_service.h" |
111 #include "content/public/browser/render_process_host.h" | 112 #include "content/public/browser/render_process_host.h" |
112 #include "content/public/browser/storage_partition.h" | 113 #include "content/public/browser/storage_partition.h" |
113 #include "content/public/browser/url_data_source.h" | 114 #include "content/public/browser/url_data_source.h" |
114 #include "content/public/browser/user_metrics.h" | 115 #include "content/public/browser/user_metrics.h" |
115 #include "content/public/common/content_constants.h" | 116 #include "content/public/common/content_constants.h" |
116 #include "content/public/common/page_zoom.h" | 117 #include "content/public/common/page_zoom.h" |
117 #include "extensions/features/features.h" | 118 #include "extensions/features/features.h" |
119 #include "net/http/http_network_session.h" | |
118 #include "ppapi/features/features.h" | 120 #include "ppapi/features/features.h" |
119 #include "printing/features/features.h" | 121 #include "printing/features/features.h" |
120 #include "ui/base/l10n/l10n_util.h" | 122 #include "ui/base/l10n/l10n_util.h" |
121 | 123 |
122 #if defined(OS_CHROMEOS) | 124 #if defined(OS_CHROMEOS) |
123 #include "chrome/browser/chromeos/locale_change_guard.h" | 125 #include "chrome/browser/chromeos/locale_change_guard.h" |
124 #include "chrome/browser/chromeos/preferences.h" | 126 #include "chrome/browser/chromeos/preferences.h" |
125 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 127 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
126 #include "components/user_manager/user_manager.h" | 128 #include "components/user_manager/user_manager.h" |
127 #endif | 129 #endif |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
615 | 617 |
616 // Make sure we initialize the ProfileIOData after everything else has been | 618 // Make sure we initialize the ProfileIOData after everything else has been |
617 // initialized that we might be reading from the IO thread. | 619 // initialized that we might be reading from the IO thread. |
618 | 620 |
619 io_data_.Init(cookie_path, channel_id_path, cache_path, | 621 io_data_.Init(cookie_path, channel_id_path, cache_path, |
620 cache_max_size, media_cache_path, media_cache_max_size, | 622 cache_max_size, media_cache_path, media_cache_max_size, |
621 extensions_cookie_path, GetPath(), predictor_, | 623 extensions_cookie_path, GetPath(), predictor_, |
622 session_cookie_mode, GetSpecialStoragePolicy(), | 624 session_cookie_mode, GetSpecialStoragePolicy(), |
623 CreateDomainReliabilityMonitor(local_state)); | 625 CreateDomainReliabilityMonitor(local_state)); |
624 | 626 |
627 DCHECK(!net_pref_observer_); | |
628 NetPrefObserver::UpdateNetParamsCallback update_net_params_callback = | |
629 base::Bind(&ProfileImplIOData::Handle::UpdateNetParamsOnIOThread, | |
630 base::Unretained(&io_data_)); | |
631 net_pref_observer_ = base::MakeUnique<NetPrefObserver>( | |
632 prefs_.get(), update_net_params_callback); | |
mmenke
2017/01/06 16:18:43
Why can't all this be done in ProfileIOData::Initi
pmarko
2017/01/08 20:51:48
Done.
| |
633 | |
625 #if BUILDFLAG(ENABLE_PLUGINS) | 634 #if BUILDFLAG(ENABLE_PLUGINS) |
626 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( | 635 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( |
627 this, io_data_.GetResourceContextNoInit()); | 636 this, io_data_.GetResourceContextNoInit()); |
628 #endif | 637 #endif |
629 | 638 |
630 TRACE_EVENT0("browser", "ProfileImpl::SetSaveSessionStorageOnDisk"); | 639 TRACE_EVENT0("browser", "ProfileImpl::SetSaveSessionStorageOnDisk"); |
631 content::BrowserContext::GetDefaultStoragePartition(this)-> | 640 content::BrowserContext::GetDefaultStoragePartition(this)-> |
632 GetDOMStorageContext()->SetSaveSessionStorageOnDisk(); | 641 GetDOMStorageContext()->SetSaveSessionStorageOnDisk(); |
633 | 642 |
634 // The DomDistillerViewerSource is not a normal WebUI so it must be registered | 643 // The DomDistillerViewerSource is not a normal WebUI so it must be registered |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1284 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1293 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1285 domain_reliability::DomainReliabilityService* service = | 1294 domain_reliability::DomainReliabilityService* service = |
1286 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1295 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1287 GetForBrowserContext(this); | 1296 GetForBrowserContext(this); |
1288 if (!service) | 1297 if (!service) |
1289 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1298 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1290 | 1299 |
1291 return service->CreateMonitor( | 1300 return service->CreateMonitor( |
1292 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 1301 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
1293 } | 1302 } |
OLD | NEW |