Bug 1667276 - Pre: Disable the startup cache when running a background task. r=dthayer

Differential Revision: https://phabricator.services.mozilla.com/D95198
This commit is contained in:
Dave Townsend 2021-01-27 22:53:54 +00:00
Родитель 09e52162fa
Коммит b57ef60b0e
2 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -35,6 +35,9 @@
#include "GeckoProfiler.h"
#include "nsAppRunner.h"
#include "xpcpublic.h"
#ifdef MOZ_BACKGROUNDTASKS
# include "mozilla/BackgroundTasks.h"
#endif
#if defined(XP_WIN)
# include <windows.h>
@ -115,6 +118,12 @@ StartupCache* StartupCache::GetSingletonNoInit() {
}
StartupCache* StartupCache::GetSingleton() {
#ifdef MOZ_BACKGROUNDTASKS
if (BackgroundTasks::IsBackgroundTaskMode()) {
return nullptr;
}
#endif
if (!gStartupCache) {
if (!XRE_IsParentProcess()) {
return nullptr;

Просмотреть файл

@ -31,4 +31,7 @@ XPIDL_SOURCES += [
"nsIStartupCacheInfo.idl",
]
if CONFIG["MOZ_BACKGROUNDTASKS"]:
DEFINES["MOZ_BACKGROUNDTASKS"] = True
FINAL_LIBRARY = "xul"