зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1767214: Avoid executing WorkerMainThreadRunnable::Run late in shutdown. r=dom-worker-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D145577
This commit is contained in:
Родитель
5ccb26922f
Коммит
4b7e774817
|
@ -11,6 +11,7 @@
|
|||
#include "jsapi.h"
|
||||
#include "jsfriendapi.h"
|
||||
#include "mozilla/AlreadyAddRefed.h"
|
||||
#include "mozilla/AppShutdown.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
|
@ -584,6 +585,12 @@ NS_IMETHODIMP
|
|||
WorkerMainThreadRunnable::Run() {
|
||||
AssertIsOnMainThread();
|
||||
|
||||
// This shouldn't be necessary once we're better about making sure no workers
|
||||
// are created during shutdown in earlier phases.
|
||||
if (AppShutdown::IsInOrBeyond(ShutdownPhase::XPCOMShutdownThreads)) {
|
||||
return NS_ERROR_ILLEGAL_DURING_SHUTDOWN;
|
||||
}
|
||||
|
||||
bool runResult = MainThreadRun();
|
||||
|
||||
RefPtr<MainThreadStopSyncLoopRunnable> response =
|
||||
|
|
Загрузка…
Ссылка в новой задаче