diff --git a/js/xpconnect/loader/ScriptPreloader.cpp b/js/xpconnect/loader/ScriptPreloader.cpp index 211d2e68381b..8e6d0c65c9bb 100644 --- a/js/xpconnect/loader/ScriptPreloader.cpp +++ b/js/xpconnect/loader/ScriptPreloader.cpp @@ -26,7 +26,6 @@ #include "mozilla/dom/ContentChild.h" #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/Document.h" -#include "mozilla/scache/StartupCache.h" #include "js/CompileOptions.h" // JS::ReadOnlyCompileOptions #include "js/experimental/JSStencil.h" @@ -66,9 +65,6 @@ using mozilla::dom::AutoJSAPI; using mozilla::dom::ContentChild; using mozilla::dom::ContentParent; using namespace mozilla::loader; -using mozilla::scache::StartupCache; - -using namespace JS; ProcessType ScriptPreloader::sProcessType; @@ -396,10 +392,6 @@ Result, nsresult> ScriptPreloader::GetCacheFile( static const uint8_t MAGIC[] = "mozXDRcachev002"; Result ScriptPreloader::OpenCache() { - if (StartupCache::GetIgnoreDiskCache()) { - return Err(NS_ERROR_ABORT); - } - MOZ_TRY(NS_GetSpecialDirectory("ProfLDS", getter_AddRefs(mProfD))); nsCOMPtr cacheFile; diff --git a/js/xpconnect/loader/URLPreloader.cpp b/js/xpconnect/loader/URLPreloader.cpp index 60a1cea3a03d..d7b3fde867be 100644 --- a/js/xpconnect/loader/URLPreloader.cpp +++ b/js/xpconnect/loader/URLPreloader.cpp @@ -17,7 +17,6 @@ #include "mozilla/Services.h" #include "mozilla/Unused.h" #include "mozilla/Vector.h" -#include "mozilla/scache/StartupCache.h" #include "MainThreadUtils.h" #include "nsPrintfCString.h" @@ -45,7 +44,6 @@ bool StartsWith(const T& haystack, const T& needle) { } // anonymous namespace using namespace mozilla::loader; -using mozilla::scache::StartupCache; nsresult URLPreloader::CollectReports(nsIHandleReportCallback* aHandleReport, nsISupports* aData, bool aAnonymize) { @@ -170,10 +168,6 @@ Result, nsresult> URLPreloader::GetCacheFile( static const uint8_t URL_MAGIC[] = "mozURLcachev002"; Result, nsresult> URLPreloader::FindCacheFile() { - if (StartupCache::GetIgnoreDiskCache()) { - return Err(NS_ERROR_ABORT); - } - nsCOMPtr cacheFile; MOZ_TRY_VAR(cacheFile, GetCacheFile(u".bin"_ns)); diff --git a/startupcache/StartupCache.cpp b/startupcache/StartupCache.cpp index 974e57433bf2..50ce9d8e4b2c 100644 --- a/startupcache/StartupCache.cpp +++ b/startupcache/StartupCache.cpp @@ -695,10 +695,6 @@ void StartupCache::IgnoreDiskCache() { if (gStartupCache) gStartupCache->InvalidateCache(); } -bool StartupCache::GetIgnoreDiskCache() { - return gIgnoreDiskCache; -} - void StartupCache::WaitOnPrefetchThread() { if (!mPrefetchThread || mPrefetchThread == PR_GetCurrentThread()) return; diff --git a/startupcache/StartupCache.h b/startupcache/StartupCache.h index fe1b98e6fbab..cb34c8932251 100644 --- a/startupcache/StartupCache.h +++ b/startupcache/StartupCache.h @@ -165,8 +165,6 @@ class StartupCache : public nsIMemoryReporter { // Signal that data should not be loaded from the cache file static void IgnoreDiskCache(); - static bool GetIgnoreDiskCache(); - // In DEBUG builds, returns a stream that will attempt to check for // and disallow multiple writes of the same object. nsresult GetDebugObjectOutputStream(nsIObjectOutputStream* aStream, diff --git a/toolkit/crashreporter/CrashAnnotations.yaml b/toolkit/crashreporter/CrashAnnotations.yaml index 54236de5e708..a42849843bd4 100644 --- a/toolkit/crashreporter/CrashAnnotations.yaml +++ b/toolkit/crashreporter/CrashAnnotations.yaml @@ -553,11 +553,6 @@ LastInteractionDuration: type: integer ping: true -LastStartupWasCrash: - description: > - True if the last startup was detected to have been a crash. - type: boolean - MacMemoryPressure: description: > The current memory pressure state as provided by the macOS memory pressure @@ -786,12 +781,6 @@ ShutdownProgress: type: string ping: true -StartupCacheValid: - description: > - True if the startup cache was deemed valid and usable. Will be false if the - last session used a different browser version or had a startup cache. - type: boolean - StartupCrash: description: > If set to 1 then this crash occurred during startup. diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 6e29a9c842bc..ee509dad31c9 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -3282,6 +3282,18 @@ static bool RemoveComponentRegistries(nsIFile* aProfileDir, aLocalProfileDir->Clone(getter_AddRefs(file)); if (!file) return false; +#if defined(XP_UNIX) || defined(XP_BEOS) +# define PLATFORM_FASL_SUFFIX ".mfasl" +#elif defined(XP_WIN) +# define PLATFORM_FASL_SUFFIX ".mfl" +#endif + + file->AppendNative(nsLiteralCString("XUL" PLATFORM_FASL_SUFFIX)); + file->Remove(false); + + file->SetNativeLeafName(nsLiteralCString("XPC" PLATFORM_FASL_SUFFIX)); + file->Remove(false); + file->SetNativeLeafName("startupCache"_ns); nsresult rv = file->Remove(true); return NS_SUCCEEDED(rv) || rv == NS_ERROR_FILE_TARGET_DOES_NOT_EXIST || @@ -4742,17 +4754,11 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) { bool lastStartupWasCrash = CheckLastStartupWasCrash().unwrapOr(false); - CrashReporter::AnnotateCrashReport( - CrashReporter::Annotation::LastStartupWasCrash, lastStartupWasCrash); - if (CheckArg("purgecaches") || PR_GetEnv("MOZ_PURGE_CACHES") || lastStartupWasCrash || gSafeMode) { cachesOK = false; } - CrashReporter::AnnotateCrashReport( - CrashReporter::Annotation::StartupCacheValid, cachesOK && versionOK); - // Every time a profile is loaded by a build with a different version, // it updates the compatibility.ini file saying what version last wrote // the fastload caches. On subsequent launches if the version matches,