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

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

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