Bug 1358964: Always delete content process temp dir even when there is no profile. r=bsmedberg a=jcristau
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -1224,22 +1224,16 @@ nsXREDirProvider::DoStartup()
}
void
nsXREDirProvider::DoShutdown()
{
PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER);
if (mProfileNotified) {
-#if (defined(XP_WIN) || defined(XP_MACOSX)) && defined(MOZ_CONTENT_SANDBOX)
- if (XRE_IsParentProcess()) {
- Unused << DeleteDirIfExists(mContentProcessSandboxTempDir);
- }
-#endif
-
nsCOMPtr<nsIObserverService> obsSvc =
mozilla::services::GetObserverService();
NS_ASSERTION(obsSvc, "No observer service?");
if (obsSvc) {
static const char16_t kShutdownPersist[] = u"shutdown-persist";
obsSvc->NotifyObservers(nullptr, "profile-change-net-teardown", kShutdownPersist);
obsSvc->NotifyObservers(nullptr, "profile-change-teardown", kShutdownPersist);
@@ -1252,16 +1246,22 @@ nsXREDirProvider::DoShutdown()
// Phase 3: Notify observers of a profile change
obsSvc->NotifyObservers(nullptr, "profile-before-change", kShutdownPersist);
obsSvc->NotifyObservers(nullptr, "profile-before-change-qm", kShutdownPersist);
obsSvc->NotifyObservers(nullptr, "profile-before-change-telemetry", kShutdownPersist);
}
mProfileNotified = false;
}
+
+#if (defined(XP_WIN) || defined(XP_MACOSX)) && defined(MOZ_CONTENT_SANDBOX)
+ if (XRE_IsParentProcess()) {
+ Unused << DeleteDirIfExists(mContentProcessSandboxTempDir);
+ }
+#endif
}
#ifdef XP_WIN
static nsresult
GetShellFolderPath(int folder, nsAString& _retval)
{
wchar_t* buf;
uint32_t bufLength = _retval.GetMutableData(&buf, MAXPATHLEN + 3);