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

Unified Diff: chrome/test/testing_profile.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, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/testing_profile.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/testing_profile.cc
diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc
index aa36a1f796286bd0f264fc34919fffd3682172bb..28d5d916969985134a666de6a8fbffb0d8c6918b 100644
--- a/chrome/test/testing_profile.cc
+++ b/chrome/test/testing_profile.cc
@@ -30,6 +30,7 @@
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/browser/prefs/testing_pref_store.h"
#include "chrome/browser/prerender/prerender_manager.h"
+#include "chrome/browser/profiles/profile_dependency_manager.h"
#include "chrome/browser/search_engines/template_url_fetcher.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/sessions/session_service.h"
@@ -145,7 +146,8 @@ TestingProfile::TestingProfile()
: start_time_(Time::Now()),
testing_prefs_(NULL),
incognito_(false),
- last_session_exited_cleanly_(true) {
+ last_session_exited_cleanly_(true),
+ profile_dependency_manager_(ProfileDependencyManager::GetInstance()) {
if (!temp_dir_.CreateUniqueTempDir()) {
LOG(ERROR) << "Failed to create unique temporary directory.";
@@ -174,8 +176,11 @@ TestingProfile::TestingProfile()
TestingProfile::~TestingProfile() {
NotificationService::current()->Notify(
NotificationType::PROFILE_DESTROYED,
- Source<Profile>(this),
+ Source<Profile>(static_cast<Profile*>(this)),
NotificationService::NoDetails());
+
+ profile_dependency_manager_->DestroyProfileServices(this);
+
DestroyTopSites();
DestroyHistoryService();
// FaviconService depends on HistoryServce so destroying it later.
@@ -356,6 +361,11 @@ TestingPrefService* TestingProfile::GetTestingPrefService() {
return testing_prefs_;
}
+void TestingProfile::SetProfileDependencyManager(
+ ProfileDependencyManager* manager) {
+ profile_dependency_manager_ = manager;
+}
+
ProfileId TestingProfile::GetRuntimeId() {
return reinterpret_cast<ProfileId>(this);
}
« no previous file with comments | « chrome/test/testing_profile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698