Bug 869800 - Remove JS_GetGlobalObject from workers. r=bent

This commit is contained in:
Bobby Holley 2013-05-08 10:45:46 -07:00
parent 19143cd663
commit b860f670ea
3 changed files with 8 additions and 8 deletions

View File

@ -633,7 +633,7 @@ ScriptExecutorRunnable::WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
}
}
JS::RootedObject global(aCx, JS_GetGlobalObject(aCx));
JS::RootedObject global(aCx, JS_GetGlobalForScopeChain(aCx));
NS_ASSERTION(global, "Must have a global by now!");
JSPrincipals* principal = GetWorkerPrincipal();

View File

@ -721,7 +721,7 @@ public:
bool
WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
{
JS::Rooted<JSObject*> target(aCx, JS_GetGlobalObject(aCx));
JS::Rooted<JSObject*> target(aCx, JS_GetGlobalForScopeChain(aCx));
NS_ASSERTION(target, "This must never be null!");
aWorkerPrivate->CloseHandlerStarted();
@ -810,7 +810,7 @@ public:
NS_ASSERTION(aWorkerPrivate == GetWorkerPrivateFromContext(aCx),
"Badness!");
mainRuntime = false;
target = JS_GetGlobalObject(aCx);
target = JS_GetGlobalForScopeChain(aCx);
}
NS_ASSERTION(target, "This should never be null!");
@ -1525,7 +1525,7 @@ WorkerRunnable::Dispatch(JSContext* aCx)
JSAutoRequest ar(aCx);
JSObject* global = JS_GetGlobalObject(aCx);
JSObject* global = JS_GetGlobalForScopeChain(aCx);
Maybe<JSAutoCompartment> ac;
if (global) {
@ -1622,7 +1622,7 @@ WorkerRunnable::Run()
JS::Rooted<JSObject*> targetCompartmentObject(cx);
if (mTarget == WorkerThread) {
targetCompartmentObject = JS_GetGlobalObject(cx);
targetCompartmentObject = JS_GetGlobalForScopeChain(cx);
} else {
targetCompartmentObject = mWorkerPrivate->GetJSObject();
}
@ -3599,7 +3599,7 @@ WorkerPrivate::NotifyInternal(JSContext* aCx, Status aStatus)
// If the worker script never ran, or failed to compile, we don't need to do
// anything else, except pretend that we ran the close handler.
if (!JS_GetGlobalObject(aCx)) {
if (!JS_GetGlobalForScopeChain(aCx)) {
mCloseHandlerStarted = true;
mCloseHandlerFinished = true;
return true;
@ -3924,7 +3924,7 @@ WorkerPrivate::RunExpiredTimeouts(JSContext* aCx)
bool retval = true;
AutoPtrComparator<TimeoutInfo> comparator = GetAutoPtrComparator(mTimeouts);
JS::RootedObject global(aCx, JS_GetGlobalObject(aCx));
JS::RootedObject global(aCx, JS_GetGlobalForScopeChain(aCx));
JSPrincipals* principal = GetWorkerPrincipal();
// We want to make sure to run *something*, even if the timer fired a little

View File

@ -355,7 +355,7 @@ private:
JSFunction* adaptor =
js::NewFunctionWithReserved(aCx, UnwrapErrorEvent, 1, 0,
JS_GetGlobalObject(aCx), "unwrap");
JS_GetGlobalForScopeChain(aCx), "unwrap");
if (!adaptor) {
return false;
}