mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1030707 - Part 2: Replace AutoPushJSContext in DataStoreAddRunnable::MainThreadRun. r=bholley
This commit is contained in:
parent
b7eb3076e8
commit
459ceab3bb
@ -285,16 +285,13 @@ protected:
|
||||
{
|
||||
AssertIsOnMainThread();
|
||||
|
||||
// Get the JSContext for the target window
|
||||
nsCOMPtr<nsIScriptGlobalObject> sgo =
|
||||
do_QueryInterface(static_cast<DOMEventTargetHelper*>
|
||||
(mBackingStore.get())->GetOwner());
|
||||
MOZ_ASSERT(sgo);
|
||||
|
||||
nsCOMPtr<nsIScriptContext> scriptContext = sgo->GetContext();
|
||||
AutoPushJSContext cx(scriptContext ? scriptContext->GetNativeContext()
|
||||
: nsContentUtils::GetSafeJSContext());
|
||||
MOZ_ASSERT(cx);
|
||||
// Initialise an AutoJSAPI with the target window.
|
||||
AutoJSAPI jsapi;
|
||||
if (NS_WARN_IF(!jsapi.Init(mBackingStore->GetParentObject()))) {
|
||||
mRv.Throw(NS_ERROR_UNEXPECTED);
|
||||
return true;
|
||||
}
|
||||
JSContext* cx = jsapi.cx();
|
||||
|
||||
JS::Rooted<JS::Value> value(cx);
|
||||
if (!mObjBuffer.read(cx, &value)) {
|
||||
|
Loading…
Reference in New Issue
Block a user