Bug 1030707 - Part 6: Replace AutoPushJSContext in RuntimeService::ResumeWorkersForWindow. r=bholley

This commit is contained in:
Bob Owen 2014-06-30 20:37:25 +01:00
parent 95e7d08113
commit 3209951196

View File

@ -2123,14 +2123,11 @@ RuntimeService::ResumeWorkersForWindow(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]->SynchronizeAndResume(cx, aWindow)) {