Bug 1262630. Replace workers::GetGlobalObjectForGlobal with xpc::NativeGlobal. r=khuey

This commit is contained in:
Boris Zbarsky 2016-04-07 21:58:21 -04:00
parent 1998448029
commit 272e533b18
4 changed files with 2 additions and 25 deletions

View File

@ -101,7 +101,7 @@ CallbackObject::CallSetup::CallSetup(CallbackObject* aCallback,
}
} else {
JSObject *global = js::GetGlobalForObjectCrossCompartment(realCallback);
globalObject = workers::GetGlobalObjectForGlobal(global);
globalObject = xpc::NativeGlobal(global);
MOZ_ASSERT(globalObject);
}

View File

@ -288,7 +288,7 @@ WorkerRunnable::Run()
JSObject* global = JS::CurrentGlobalOrNull(cx);
if (global) {
globalObject = GetGlobalObjectForGlobal(global);
globalObject = xpc::NativeGlobal(global);
} else {
globalObject = DefaultGlobalObject();
}

View File

@ -863,26 +863,6 @@ WorkerDebuggerGlobalScope::Dump(JSContext* aCx,
}
}
nsIGlobalObject*
GetGlobalObjectForGlobal(JSObject* global)
{
nsIGlobalObject* globalObject = nullptr;
UNWRAP_WORKER_OBJECT(WorkerGlobalScope, global, globalObject);
if (!globalObject) {
UNWRAP_OBJECT(WorkerDebuggerGlobalScope, global, globalObject);
if (!globalObject) {
MOZ_ASSERT(IsDebuggerSandbox(global));
globalObject = static_cast<SimpleGlobalObject*>(JS_GetPrivate(global));
MOZ_ASSERT(globalObject);
}
}
return globalObject;
}
bool
IsWorkerGlobal(JSObject* object)
{

View File

@ -361,9 +361,6 @@ ThrowDOMExceptionForNSResult(JSContext* aCx, nsresult aNSResult);
} // namespace exceptions
nsIGlobalObject*
GetGlobalObjectForGlobal(JSObject* global);
bool
IsWorkerGlobal(JSObject* global);