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

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

Issue 10828263: Moving FaviconService to a ProfileKeyedService. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: resyncing with library after revert Created 8 years, 3 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 | Annotate | Revision Log
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/environment.h" 10 #include "base/environment.h"
(...skipping 21 matching lines...) Expand all
32 #include "chrome/browser/download/download_service_factory.h" 32 #include "chrome/browser/download/download_service_factory.h"
33 #include "chrome/browser/extensions/event_router.h" 33 #include "chrome/browser/extensions/event_router.h"
34 #include "chrome/browser/extensions/extension_pref_store.h" 34 #include "chrome/browser/extensions/extension_pref_store.h"
35 #include "chrome/browser/extensions/extension_pref_value_map.h" 35 #include "chrome/browser/extensions/extension_pref_value_map.h"
36 #include "chrome/browser/extensions/extension_pref_value_map_factory.h" 36 #include "chrome/browser/extensions/extension_pref_value_map_factory.h"
37 #include "chrome/browser/extensions/extension_process_manager.h" 37 #include "chrome/browser/extensions/extension_process_manager.h"
38 #include "chrome/browser/extensions/extension_service.h" 38 #include "chrome/browser/extensions/extension_service.h"
39 #include "chrome/browser/extensions/extension_special_storage_policy.h" 39 #include "chrome/browser/extensions/extension_special_storage_policy.h"
40 #include "chrome/browser/extensions/extension_system.h" 40 #include "chrome/browser/extensions/extension_system.h"
41 #include "chrome/browser/extensions/user_script_master.h" 41 #include "chrome/browser/extensions/user_script_master.h"
42 #include "chrome/browser/favicon/favicon_service.h"
43 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" 42 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h"
44 #include "chrome/browser/history/shortcuts_backend.h" 43 #include "chrome/browser/history/shortcuts_backend.h"
45 #include "chrome/browser/history/top_sites.h" 44 #include "chrome/browser/history/top_sites.h"
46 #include "chrome/browser/metrics/metrics_service.h" 45 #include "chrome/browser/metrics/metrics_service.h"
47 #include "chrome/browser/net/chrome_url_request_context.h" 46 #include "chrome/browser/net/chrome_url_request_context.h"
48 #include "chrome/browser/net/net_pref_observer.h" 47 #include "chrome/browser/net/net_pref_observer.h"
49 #include "chrome/browser/net/predictor.h" 48 #include "chrome/browser/net/predictor.h"
50 #include "chrome/browser/net/proxy_service_factory.h" 49 #include "chrome/browser/net/proxy_service_factory.h"
51 #include "chrome/browser/net/ssl_config_service_manager.h" 50 #include "chrome/browser/net/ssl_config_service_manager.h"
52 #include "chrome/browser/net/url_fixer_upper.h" 51 #include "chrome/browser/net/url_fixer_upper.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 252 }
254 253
255 ProfileImpl::ProfileImpl(const FilePath& path, 254 ProfileImpl::ProfileImpl(const FilePath& path,
256 Delegate* delegate, 255 Delegate* delegate,
257 CreateMode create_mode) 256 CreateMode create_mode)
258 : path_(path), 257 : path_(path),
259 ALLOW_THIS_IN_INITIALIZER_LIST(visited_link_event_listener_( 258 ALLOW_THIS_IN_INITIALIZER_LIST(visited_link_event_listener_(
260 new VisitedLinkEventListener(this))), 259 new VisitedLinkEventListener(this))),
261 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), 260 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)),
262 host_content_settings_map_(NULL), 261 host_content_settings_map_(NULL),
263 favicon_service_created_(false),
264 start_time_(Time::Now()), 262 start_time_(Time::Now()),
265 delegate_(delegate), 263 delegate_(delegate),
266 predictor_(NULL) { 264 predictor_(NULL) {
267 DCHECK(!path.empty()) << "Using an empty path will attempt to write " << 265 DCHECK(!path.empty()) << "Using an empty path will attempt to write " <<
268 "profile files to the root directory!"; 266 "profile files to the root directory!";
269 267
270 #if defined(ENABLE_SESSION_SERVICE) 268 #if defined(ENABLE_SESSION_SERVICE)
271 create_session_service_timer_.Start(FROM_HERE, 269 create_session_service_timer_.Start(FROM_HERE,
272 TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this, 270 TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this,
273 &ProfileImpl::EnsureSessionServiceCreated); 271 &ProfileImpl::EnsureSessionServiceCreated);
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 } else { 500 } else {
503 ExtensionPrefValueMapFactory::GetForProfile(this)-> 501 ExtensionPrefValueMapFactory::GetForProfile(this)->
504 ClearAllIncognitoSessionOnlyPreferences(); 502 ClearAllIncognitoSessionOnlyPreferences();
505 } 503 }
506 504
507 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); 505 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this);
508 506
509 if (top_sites_.get()) 507 if (top_sites_.get())
510 top_sites_->Shutdown(); 508 top_sites_->Shutdown();
511 509
512 // FaviconService depends on HistoryServce so make sure we delete
513 // HistoryService first.
514 favicon_service_.reset();
515
516 if (pref_proxy_config_tracker_.get()) 510 if (pref_proxy_config_tracker_.get())
517 pref_proxy_config_tracker_->DetachFromPrefService(); 511 pref_proxy_config_tracker_->DetachFromPrefService();
518 512
519 if (host_content_settings_map_) 513 if (host_content_settings_map_)
520 host_content_settings_map_->ShutdownOnUIThread(); 514 host_content_settings_map_->ShutdownOnUIThread();
521 515
522 // This causes the Preferences file to be written to disk. 516 // This causes the Preferences file to be written to disk.
523 if (prefs_loaded) 517 if (prefs_loaded)
524 MarkAsCleanShutdown(); 518 MarkAsCleanShutdown();
525 } 519 }
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 return io_data_.GetIsolatedMediaRequestContextGetter(id); 726 return io_data_.GetIsolatedMediaRequestContextGetter(id);
733 } 727 }
734 728
735 return io_data_.GetMediaRequestContextGetter(); 729 return io_data_.GetMediaRequestContextGetter();
736 } 730 }
737 731
738 content::ResourceContext* ProfileImpl::GetResourceContext() { 732 content::ResourceContext* ProfileImpl::GetResourceContext() {
739 return io_data_.GetResourceContext(); 733 return io_data_.GetResourceContext();
740 } 734 }
741 735
742 FaviconService* ProfileImpl::GetFaviconService(ServiceAccessType sat) {
743 if (!favicon_service_created_) {
744 favicon_service_created_ = true;
745 favicon_service_.reset(new FaviconService(this));
746 }
747 return favicon_service_.get();
748 }
749
750 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { 736 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() {
751 return io_data_.GetExtensionsRequestContextGetter(); 737 return io_data_.GetExtensionsRequestContextGetter();
752 } 738 }
753 739
754 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForIsolatedApp( 740 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForIsolatedApp(
755 const std::string& app_id) { 741 const std::string& app_id) {
756 return io_data_.GetIsolatedAppRequestContextGetter(app_id); 742 return io_data_.GetIsolatedAppRequestContextGetter(app_id);
757 } 743 }
758 744
759 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { 745 net::SSLConfigService* ProfileImpl::GetSSLConfigService() {
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 if (!path.empty()) 1089 if (!path.empty())
1104 *cache_path = path; 1090 *cache_path = path;
1105 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : 1091 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) :
1106 prefs_->GetInteger(prefs::kDiskCacheSize); 1092 prefs_->GetInteger(prefs::kDiskCacheSize);
1107 } 1093 }
1108 1094
1109 base::Callback<ChromeURLDataManagerBackend*(void)> 1095 base::Callback<ChromeURLDataManagerBackend*(void)>
1110 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { 1096 ProfileImpl::GetChromeURLDataManagerBackendGetter() const {
1111 return io_data_.GetChromeURLDataManagerBackendGetter(); 1097 return io_data_.GetChromeURLDataManagerBackendGetter();
1112 } 1098 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/sync/glue/bookmark_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698