mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1030707 - Part 4: Replace AutoPushJSContext in RuntimeService::SuspendWorkersForWindow. r=bholley
This commit is contained in:
parent
6c7bce274e
commit
0e03ff41f5
@ -2099,14 +2099,11 @@ RuntimeService::SuspendWorkersForWindow(nsPIDOMWindow* aWindow)
|
||||
GetWorkersForWindow(aWindow, workers);
|
||||
|
||||
if (!workers.IsEmpty()) {
|
||||
nsCOMPtr<nsIScriptGlobalObject> sgo = do_QueryInterface(aWindow);
|
||||
MOZ_ASSERT(sgo);
|
||||
|
||||
nsIScriptContext* scx = sgo->GetContext();
|
||||
|
||||
AutoPushJSContext cx(scx ?
|
||||
scx->GetNativeContext() :
|
||||
nsContentUtils::GetSafeJSContext());
|
||||
AutoJSAPI jsapi;
|
||||
if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(aWindow))) {
|
||||
return;
|
||||
}
|
||||
JSContext* cx = jsapi.cx();
|
||||
|
||||
for (uint32_t index = 0; index < workers.Length(); index++) {
|
||||
if (!workers[index]->Suspend(cx, aWindow)) {
|
||||
|
Loading…
Reference in New Issue
Block a user