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

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

Issue 6766004: Create a ProfileDependencyManager to order ProfileKeyedService destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix improper usage of static_cast<> in existing mac code. Created 9 years, 8 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "chrome/browser/net/ssl_config_service_manager.h" 49 #include "chrome/browser/net/ssl_config_service_manager.h"
50 #include "chrome/browser/notifications/desktop_notification_service.h" 50 #include "chrome/browser/notifications/desktop_notification_service.h"
51 #include "chrome/browser/password_manager/password_store_default.h" 51 #include "chrome/browser/password_manager/password_store_default.h"
52 #include "chrome/browser/policy/configuration_policy_pref_store.h" 52 #include "chrome/browser/policy/configuration_policy_pref_store.h"
53 #include "chrome/browser/policy/configuration_policy_provider.h" 53 #include "chrome/browser/policy/configuration_policy_provider.h"
54 #include "chrome/browser/policy/profile_policy_connector.h" 54 #include "chrome/browser/policy/profile_policy_connector.h"
55 #include "chrome/browser/prefs/browser_prefs.h" 55 #include "chrome/browser/prefs/browser_prefs.h"
56 #include "chrome/browser/prefs/pref_value_store.h" 56 #include "chrome/browser/prefs/pref_value_store.h"
57 #include "chrome/browser/prerender/prerender_manager.h" 57 #include "chrome/browser/prerender/prerender_manager.h"
58 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" 58 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
59 #include "chrome/browser/profiles/profile_dependency_manager.h"
59 #include "chrome/browser/profiles/profile_manager.h" 60 #include "chrome/browser/profiles/profile_manager.h"
60 #include "chrome/browser/search_engines/template_url_fetcher.h" 61 #include "chrome/browser/search_engines/template_url_fetcher.h"
61 #include "chrome/browser/search_engines/template_url_model.h" 62 #include "chrome/browser/search_engines/template_url_model.h"
62 #include "chrome/browser/sessions/session_service.h" 63 #include "chrome/browser/sessions/session_service.h"
63 #include "chrome/browser/sessions/tab_restore_service.h" 64 #include "chrome/browser/sessions/tab_restore_service.h"
64 #include "chrome/browser/spellcheck_host.h" 65 #include "chrome/browser/spellcheck_host.h"
65 #include "chrome/browser/ssl/ssl_host_state.h" 66 #include "chrome/browser/ssl/ssl_host_state.h"
66 #include "chrome/browser/status_icons/status_tray.h" 67 #include "chrome/browser/status_icons/status_tray.h"
67 #include "chrome/browser/sync/profile_sync_factory_impl.h" 68 #include "chrome/browser/sync/profile_sync_factory_impl.h"
68 #include "chrome/browser/sync/profile_sync_service.h" 69 #include "chrome/browser/sync/profile_sync_service.h"
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 } 523 }
523 524
524 ProfileImpl::~ProfileImpl() { 525 ProfileImpl::~ProfileImpl() {
525 NotificationService::current()->Notify( 526 NotificationService::current()->Notify(
526 NotificationType::PROFILE_DESTROYED, 527 NotificationType::PROFILE_DESTROYED,
527 Source<Profile>(this), 528 Source<Profile>(this),
528 NotificationService::NoDetails()); 529 NotificationService::NoDetails());
529 530
530 GetPolicyConnector()->Shutdown(); 531 GetPolicyConnector()->Shutdown();
531 532
533 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this);
534
532 tab_restore_service_ = NULL; 535 tab_restore_service_ = NULL;
533 536
534 StopCreateSessionServiceTimer(); 537 StopCreateSessionServiceTimer();
535 // TemplateURLModel schedules a task on the WebDataService from its 538 // TemplateURLModel schedules a task on the WebDataService from its
536 // destructor. Delete it first to ensure the task gets scheduled before we 539 // destructor. Delete it first to ensure the task gets scheduled before we
537 // shut down the database. 540 // shut down the database.
538 template_url_model_.reset(); 541 template_url_model_.reset();
539 542
540 // DownloadManager is lazily created, so check before accessing it. 543 // DownloadManager is lazily created, so check before accessing it.
541 if (download_manager_.get()) { 544 if (download_manager_.get()) {
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1491 return pref_proxy_config_tracker_; 1494 return pref_proxy_config_tracker_;
1492 } 1495 }
1493 1496
1494 prerender::PrerenderManager* ProfileImpl::GetPrerenderManager() { 1497 prerender::PrerenderManager* ProfileImpl::GetPrerenderManager() {
1495 if (!prerender::PrerenderManager::IsPrerenderingEnabled()) 1498 if (!prerender::PrerenderManager::IsPrerenderingEnabled())
1496 return NULL; 1499 return NULL;
1497 if (!prerender_manager_) 1500 if (!prerender_manager_)
1498 prerender_manager_ = new prerender::PrerenderManager(this); 1501 prerender_manager_ = new prerender::PrerenderManager(this);
1499 return prerender_manager_; 1502 return prerender_manager_;
1500 } 1503 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_dependency_manager_unittest.cc ('k') | chrome/browser/profiles/profile_keyed_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698