Loading js/xpconnect/loader/ScriptPreloader.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ #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" Loading Loading @@ -65,6 +66,9 @@ 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; Loading Loading @@ -392,6 +396,10 @@ Result<nsCOMPtr<nsIFile>, nsresult> ScriptPreloader::GetCacheFile( static const uint8_t MAGIC[] = "mozXDRcachev002"; Result<Ok, nsresult> ScriptPreloader::OpenCache() { if (StartupCache::GetIgnoreDiskCache()) { return Err(NS_ERROR_ABORT); } MOZ_TRY(NS_GetSpecialDirectory("ProfLDS", getter_AddRefs(mProfD))); nsCOMPtr<nsIFile> cacheFile; Loading js/xpconnect/loader/URLPreloader.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include "mozilla/Services.h" #include "mozilla/Unused.h" #include "mozilla/Vector.h" #include "mozilla/scache/StartupCache.h" #include "MainThreadUtils.h" #include "nsPrintfCString.h" Loading Loading @@ -44,6 +45,7 @@ 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) { Loading Loading @@ -168,6 +170,10 @@ Result<nsCOMPtr<nsIFile>, nsresult> URLPreloader::GetCacheFile( static const uint8_t URL_MAGIC[] = "mozURLcachev002"; Result<nsCOMPtr<nsIFile>, nsresult> URLPreloader::FindCacheFile() { if (StartupCache::GetIgnoreDiskCache()) { return Err(NS_ERROR_ABORT); } nsCOMPtr<nsIFile> cacheFile; MOZ_TRY_VAR(cacheFile, GetCacheFile(u".bin"_ns)); Loading startupcache/StartupCache.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -695,6 +695,10 @@ void StartupCache::IgnoreDiskCache() { if (gStartupCache) gStartupCache->InvalidateCache(); } bool StartupCache::GetIgnoreDiskCache() { return gIgnoreDiskCache; } void StartupCache::WaitOnPrefetchThread() { if (!mPrefetchThread || mPrefetchThread == PR_GetCurrentThread()) return; Loading startupcache/StartupCache.h +2 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,8 @@ 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, Loading Loading
js/xpconnect/loader/ScriptPreloader.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ #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" Loading Loading @@ -65,6 +66,9 @@ 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; Loading Loading @@ -392,6 +396,10 @@ Result<nsCOMPtr<nsIFile>, nsresult> ScriptPreloader::GetCacheFile( static const uint8_t MAGIC[] = "mozXDRcachev002"; Result<Ok, nsresult> ScriptPreloader::OpenCache() { if (StartupCache::GetIgnoreDiskCache()) { return Err(NS_ERROR_ABORT); } MOZ_TRY(NS_GetSpecialDirectory("ProfLDS", getter_AddRefs(mProfD))); nsCOMPtr<nsIFile> cacheFile; Loading
js/xpconnect/loader/URLPreloader.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include "mozilla/Services.h" #include "mozilla/Unused.h" #include "mozilla/Vector.h" #include "mozilla/scache/StartupCache.h" #include "MainThreadUtils.h" #include "nsPrintfCString.h" Loading Loading @@ -44,6 +45,7 @@ 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) { Loading Loading @@ -168,6 +170,10 @@ Result<nsCOMPtr<nsIFile>, nsresult> URLPreloader::GetCacheFile( static const uint8_t URL_MAGIC[] = "mozURLcachev002"; Result<nsCOMPtr<nsIFile>, nsresult> URLPreloader::FindCacheFile() { if (StartupCache::GetIgnoreDiskCache()) { return Err(NS_ERROR_ABORT); } nsCOMPtr<nsIFile> cacheFile; MOZ_TRY_VAR(cacheFile, GetCacheFile(u".bin"_ns)); Loading
startupcache/StartupCache.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -695,6 +695,10 @@ void StartupCache::IgnoreDiskCache() { if (gStartupCache) gStartupCache->InvalidateCache(); } bool StartupCache::GetIgnoreDiskCache() { return gIgnoreDiskCache; } void StartupCache::WaitOnPrefetchThread() { if (!mPrefetchThread || mPrefetchThread == PR_GetCurrentThread()) return; Loading
startupcache/StartupCache.h +2 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,8 @@ 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, Loading