Chromium Code Reviews| 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 <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 20 matching lines...) Expand all Loading... | |
| 31 #include "chrome/browser/background/background_contents_service_factory.h" | 31 #include "chrome/browser/background/background_contents_service_factory.h" |
| 32 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 32 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 33 #include "chrome/browser/browser_process.h" | 33 #include "chrome/browser/browser_process.h" |
| 34 #include "chrome/browser/chrome_notification_types.h" | 34 #include "chrome/browser/chrome_notification_types.h" |
| 35 #include "chrome/browser/content_settings/cookie_settings.h" | 35 #include "chrome/browser/content_settings/cookie_settings.h" |
| 36 #include "chrome/browser/dom_distiller/profile_utils.h" | 36 #include "chrome/browser/dom_distiller/profile_utils.h" |
| 37 #include "chrome/browser/domain_reliability/service_factory.h" | 37 #include "chrome/browser/domain_reliability/service_factory.h" |
| 38 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 38 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
| 39 #include "chrome/browser/download/download_service.h" | 39 #include "chrome/browser/download/download_service.h" |
| 40 #include "chrome/browser/download/download_service_factory.h" | 40 #include "chrome/browser/download/download_service_factory.h" |
| 41 #include "chrome/browser/history/top_sites.h" | |
| 42 #include "chrome/browser/net/chrome_net_log.h" | 41 #include "chrome/browser/net/chrome_net_log.h" |
| 43 #include "chrome/browser/net/net_pref_observer.h" | 42 #include "chrome/browser/net/net_pref_observer.h" |
| 44 #include "chrome/browser/net/predictor.h" | 43 #include "chrome/browser/net/predictor.h" |
| 45 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 44 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
| 46 #include "chrome/browser/net/proxy_service_factory.h" | 45 #include "chrome/browser/net/proxy_service_factory.h" |
| 47 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 46 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
| 48 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h" | 47 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h" |
| 49 #include "chrome/browser/net/ssl_config_service_manager.h" | 48 #include "chrome/browser/net/ssl_config_service_manager.h" |
| 50 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 49 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
| 51 #include "chrome/browser/plugins/plugin_prefs.h" | 50 #include "chrome/browser/plugins/plugin_prefs.h" |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 817 } else { | 816 } else { |
| 818 #if defined(ENABLE_EXTENSIONS) | 817 #if defined(ENABLE_EXTENSIONS) |
| 819 ExtensionPrefValueMapFactory::GetForBrowserContext(this)-> | 818 ExtensionPrefValueMapFactory::GetForBrowserContext(this)-> |
| 820 ClearAllIncognitoSessionOnlyPreferences(); | 819 ClearAllIncognitoSessionOnlyPreferences(); |
| 821 #endif | 820 #endif |
| 822 } | 821 } |
| 823 | 822 |
| 824 BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices( | 823 BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices( |
| 825 this); | 824 this); |
| 826 | 825 |
| 827 if (top_sites_.get()) | |
| 828 top_sites_->Shutdown(); | |
|
sdefresne
2015/01/21 17:57:23
This line was the only call to "TopSites::Shutdown
| |
| 829 | |
| 830 if (pref_proxy_config_tracker_) | 826 if (pref_proxy_config_tracker_) |
| 831 pref_proxy_config_tracker_->DetachFromPrefService(); | 827 pref_proxy_config_tracker_->DetachFromPrefService(); |
| 832 | 828 |
| 833 if (host_content_settings_map_.get()) | 829 if (host_content_settings_map_.get()) |
| 834 host_content_settings_map_->ShutdownOnUIThread(); | 830 host_content_settings_map_->ShutdownOnUIThread(); |
| 835 | 831 |
| 836 // This causes the Preferences file to be written to disk. | 832 // This causes the Preferences file to be written to disk. |
| 837 if (prefs_loaded) | 833 if (prefs_loaded) |
| 838 SetExitType(EXIT_NORMAL); | 834 SetExitType(EXIT_NORMAL); |
| 839 } | 835 } |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1162 if (profile == static_cast<Profile*>(this)) | 1158 if (profile == static_cast<Profile*>(this)) |
| 1163 return true; | 1159 return true; |
| 1164 Profile* otr_profile = off_the_record_profile_.get(); | 1160 Profile* otr_profile = off_the_record_profile_.get(); |
| 1165 return otr_profile && profile == otr_profile; | 1161 return otr_profile && profile == otr_profile; |
| 1166 } | 1162 } |
| 1167 | 1163 |
| 1168 Time ProfileImpl::GetStartTime() const { | 1164 Time ProfileImpl::GetStartTime() const { |
| 1169 return start_time_; | 1165 return start_time_; |
| 1170 } | 1166 } |
| 1171 | 1167 |
| 1172 history::TopSites* ProfileImpl::GetTopSites() { | |
| 1173 if (!top_sites_.get()) { | |
| 1174 top_sites_ = history::TopSites::Create( | |
| 1175 this, GetPath().Append(chrome::kTopSitesFilename)); | |
| 1176 } | |
| 1177 return top_sites_.get(); | |
| 1178 } | |
| 1179 | |
| 1180 history::TopSites* ProfileImpl::GetTopSitesWithoutCreating() { | |
| 1181 return top_sites_.get(); | |
| 1182 } | |
| 1183 | |
| 1184 #if defined(ENABLE_SESSION_SERVICE) | 1168 #if defined(ENABLE_SESSION_SERVICE) |
| 1185 void ProfileImpl::StopCreateSessionServiceTimer() { | 1169 void ProfileImpl::StopCreateSessionServiceTimer() { |
| 1186 create_session_service_timer_.Stop(); | 1170 create_session_service_timer_.Stop(); |
| 1187 } | 1171 } |
| 1188 | 1172 |
| 1189 void ProfileImpl::EnsureSessionServiceCreated() { | 1173 void ProfileImpl::EnsureSessionServiceCreated() { |
| 1190 SessionServiceFactory::GetForProfile(this); | 1174 SessionServiceFactory::GetForProfile(this); |
| 1191 } | 1175 } |
| 1192 #endif | 1176 #endif |
| 1193 | 1177 |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1419 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1403 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
| 1420 domain_reliability::DomainReliabilityService* service = | 1404 domain_reliability::DomainReliabilityService* service = |
| 1421 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1405 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
| 1422 GetForBrowserContext(this); | 1406 GetForBrowserContext(this); |
| 1423 if (!service) | 1407 if (!service) |
| 1424 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1408 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
| 1425 | 1409 |
| 1426 return service->CreateMonitor( | 1410 return service->CreateMonitor( |
| 1427 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1411 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
| 1428 } | 1412 } |
| OLD | NEW |