mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
Bug 1171486 - Part 2: Make it OK to call ServiceWorkerManager::GetInstance() during its Init() function; r=baku
This commit is contained in:
parent
e03391c07e
commit
a402da64d1
@ -2295,12 +2295,13 @@ ServiceWorkerManager::GetInstance()
|
|||||||
// this can resurrect the ServiceWorkerManager pretty late during shutdown.
|
// this can resurrect the ServiceWorkerManager pretty late during shutdown.
|
||||||
static bool firstTime = true;
|
static bool firstTime = true;
|
||||||
if (firstTime) {
|
if (firstTime) {
|
||||||
|
firstTime = false;
|
||||||
|
|
||||||
AssertIsOnMainThread();
|
AssertIsOnMainThread();
|
||||||
|
|
||||||
gInstance = new ServiceWorkerManager();
|
gInstance = new ServiceWorkerManager();
|
||||||
gInstance->Init();
|
gInstance->Init();
|
||||||
ClearOnShutdown(&gInstance);
|
ClearOnShutdown(&gInstance);
|
||||||
firstTime = false;
|
|
||||||
}
|
}
|
||||||
nsRefPtr<ServiceWorkerManager> copy = gInstance.get();
|
nsRefPtr<ServiceWorkerManager> copy = gInstance.get();
|
||||||
return copy.forget();
|
return copy.forget();
|
||||||
|
Loading…
Reference in New Issue
Block a user