Bug 1639553 - Only flush xulstore writes if using new xulstore r=lina
authorDoug Thayer <dothayer@mozilla.com>
Wed, 20 May 2020 16:32:07 +0000
changeset 531304 ec19c0ab7a8b107cbbb8d6a2a3470feb1a66b084
parent 531303 0356e5fff183afb22f6eeca0e53ab8ec56745fad
child 531305 6592fdffea8e6d55a0ed91f56401319752b997a2
push id37437
push usernerli@mozilla.com
push dateThu, 21 May 2020 02:34:41 +0000
treeherdermozilla-central@3d91ba9e1d25 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslina
bugs1639553
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1639553 - Only flush xulstore writes if using new xulstore r=lina Differential Revision: https://phabricator.services.mozilla.com/D76169
xpcom/base/AppShutdown.cpp
--- a/xpcom/base/AppShutdown.cpp
+++ b/xpcom/base/AppShutdown.cpp
@@ -15,22 +15,25 @@
 #include "GeckoProfiler.h"
 #include "mozilla/CmdLineAndEnvUtils.h"
 #include "mozilla/PoisonIOInterposer.h"
 #include "mozilla/Printf.h"
 #include "mozilla/scache/StartupCache.h"
 #include "mozilla/StartupTimeline.h"
 #include "mozilla/StaticPrefs_toolkit.h"
 #include "mozilla/LateWriteChecks.h"
-#include "mozilla/XULStore.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsAppRunner.h"
 #include "nsDirectoryServiceUtils.h"
 #include "prenv.h"
 
+#ifdef MOZ_NEW_XULSTORE
+#  include "mozilla/XULStore.h"
+#endif
+
 namespace mozilla {
 
 static ShutdownPhase sFastShutdownPhase = ShutdownPhase::NotInShutdown;
 static ShutdownPhase sLateWriteChecksPhase = ShutdownPhase::NotInShutdown;
 static AppShutdownMode sShutdownMode = AppShutdownMode::Normal;
 static bool sIsShuttingDown = false;
 
 // These environment variable strings are all deliberately copied and leaked
@@ -145,18 +148,21 @@ void AppShutdown::Init(AppShutdownMode a
 void AppShutdown::MaybeFastShutdown(ShutdownPhase aPhase) {
   // For writes which we want to ensure are recorded, we don't want to trip
   // the late write checking code. Anything that writes to disk and which
   // we don't want to skip should be listed out explicitly in this section.
   if (aPhase == sFastShutdownPhase || aPhase == sLateWriteChecksPhase) {
     if (auto* cache = scache::StartupCache::GetSingletonNoInit()) {
       cache->EnsureShutdownWriteComplete();
     }
+
+#ifdef MOZ_NEW_XULSTORE
     DebugOnly<nsresult> rv = XULStore::Shutdown();
     NS_ASSERTION(NS_SUCCEEDED(rv), "XULStore::Shutdown() failed.");
+#endif
   }
   if (aPhase == sFastShutdownPhase) {
     StopLateWriteChecks();
     RecordShutdownEndTimeStamp();
     MaybeDoRestart();
 
 #ifdef MOZ_GECKO_PROFILER
     profiler_shutdown(IsFastShutdown::Yes);