From f534f4aef3b0f58b64b4a4143fade8fb0d0802c0 Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Wed, 10 Feb 2016 10:53:26 -0800 Subject: [PATCH] Bug 1246828: Push QuotaManager shutdown back to profile-before-change2 --- dom/quota/ActorsParent.cpp | 8 ++++---- dom/quota/QuotaManagerService.cpp | 6 +++--- testing/xpcshell/head.js | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dom/quota/ActorsParent.cpp b/dom/quota/ActorsParent.cpp index f9ced8a20d3..336235d51de 100644 --- a/dom/quota/ActorsParent.cpp +++ b/dom/quota/ActorsParent.cpp @@ -89,8 +89,8 @@ // Preference that is used to enable testing features #define PREF_TESTING_FEATURES "dom.quotaManager.testing" -// profile-before-change, when we need to shut down quota manager -#define PROFILE_BEFORE_CHANGE_OBSERVER_ID "profile-before-change" +// profile-before-change2, when we need to shut down quota manager +#define PROFILE_BEFORE_CHANGE2_OBSERVER_ID "profile-before-change2" // The name of the file that we use to load/save the last access time of an // origin. @@ -2180,7 +2180,7 @@ CreateRunnable::RegisterObserver() nsCOMPtr observer = new ShutdownObserver(mOwningThread); nsresult rv = observerService->AddObserver(observer, - PROFILE_BEFORE_CHANGE_OBSERVER_ID, + PROFILE_BEFORE_CHANGE2_OBSERVER_ID, false); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; @@ -2329,7 +2329,7 @@ ShutdownObserver::Observe(nsISupports* aSubject, const char16_t* aData) { MOZ_ASSERT(NS_IsMainThread()); - MOZ_ASSERT(!strcmp(aTopic, PROFILE_BEFORE_CHANGE_OBSERVER_ID)); + MOZ_ASSERT(!strcmp(aTopic, PROFILE_BEFORE_CHANGE2_OBSERVER_ID)); bool done = false; diff --git a/dom/quota/QuotaManagerService.cpp b/dom/quota/QuotaManagerService.cpp index aefa9f57dc3..206814ec35a 100644 --- a/dom/quota/QuotaManagerService.cpp +++ b/dom/quota/QuotaManagerService.cpp @@ -25,7 +25,7 @@ #include "QuotaManager.h" #include "QuotaRequests.h" -#define PROFILE_BEFORE_CHANGE_OBSERVER_ID "profile-before-change" +#define PROFILE_BEFORE_CHANGE2_OBSERVER_ID "profile-before-change2" namespace mozilla { namespace dom { @@ -296,7 +296,7 @@ QuotaManagerService::Init() } nsresult rv = observerService->AddObserver(this, - PROFILE_BEFORE_CHANGE_OBSERVER_ID, + PROFILE_BEFORE_CHANGE2_OBSERVER_ID, false); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; @@ -638,7 +638,7 @@ QuotaManagerService::Observe(nsISupports* aSubject, MOZ_ASSERT(XRE_IsParentProcess()); MOZ_ASSERT(NS_IsMainThread()); - if (!strcmp(aTopic, PROFILE_BEFORE_CHANGE_OBSERVER_ID)) { + if (!strcmp(aTopic, PROFILE_BEFORE_CHANGE2_OBSERVER_ID)) { RemoveIdleObserver(); return NS_OK; } diff --git a/testing/xpcshell/head.js b/testing/xpcshell/head.js index 414f376598b..467dd8a55af 100644 --- a/testing/xpcshell/head.js +++ b/testing/xpcshell/head.js @@ -614,6 +614,7 @@ function _execute_test() { obs.notifyObservers(null, "profile-change-net-teardown", null); obs.notifyObservers(null, "profile-change-teardown", null); obs.notifyObservers(null, "profile-before-change", null); + obs.notifyObservers(null, "profile-before-change2", null); _profileInitialized = false; }