mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1125423 part 6 - Remove nsGlobalWindow::OuterObject and ObjectToOuterObjectValue. r=bz
This commit is contained in:
parent
6ab2859b19
commit
048986ef1e
@ -2033,40 +2033,6 @@ nsGlobalWindow::TraceGlobalJSObject(JSTracer* aTrc)
|
||||
TraceWrapper(aTrc, "active window global");
|
||||
}
|
||||
|
||||
/* static */
|
||||
JSObject*
|
||||
nsGlobalWindow::OuterObject(JSContext* aCx, JS::Handle<JSObject*> aObj)
|
||||
{
|
||||
nsGlobalWindow* origWin = UnwrapDOMObject<nsGlobalWindow>(aObj);
|
||||
nsGlobalWindow* win = origWin->GetOuterWindowInternal();
|
||||
|
||||
if (!win) {
|
||||
// If we no longer have an outer window. No code should ever be
|
||||
// running on a window w/o an outer, which means this hook should
|
||||
// never be called when we have no outer. But just in case, return
|
||||
// null to prevent leaking an inner window to code in a different
|
||||
// window.
|
||||
NS_WARNING("nsGlobalWindow::OuterObject shouldn't fail!");
|
||||
Throw(aCx, NS_ERROR_UNEXPECTED);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
JS::Rooted<JSObject*> winObj(aCx, win->FastGetGlobalJSObject());
|
||||
MOZ_ASSERT(winObj);
|
||||
|
||||
// Note that while |wrapper| is same-compartment with cx, the outer window
|
||||
// might not be. If we're running script in an inactive scope and evalute
|
||||
// |this|, the outer window is actually a cross-compartment wrapper. So we
|
||||
// need to wrap here.
|
||||
if (!JS_WrapObject(aCx, &winObj)) {
|
||||
NS_WARNING("nsGlobalWindow::OuterObject shouldn't fail!");
|
||||
Throw(aCx, NS_ERROR_UNEXPECTED);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return winObj;
|
||||
}
|
||||
|
||||
bool
|
||||
nsGlobalWindow::WouldReuseInnerWindow(nsIDocument* aNewDocument)
|
||||
{
|
||||
|
@ -359,8 +359,6 @@ public:
|
||||
|
||||
virtual bool IsBlackForCC(bool aTracingNeeded = true) override;
|
||||
|
||||
static JSObject* OuterObject(JSContext* aCx, JS::Handle<JSObject*> aObj);
|
||||
|
||||
// nsIScriptObjectPrincipal
|
||||
virtual nsIPrincipal* GetPrincipal() override;
|
||||
|
||||
|
@ -3122,13 +3122,5 @@ DeprecationWarning(JSContext* aCx, JSObject* aObject,
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
ObjectToOuterObjectValue(JSContext* cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JS::Value> vp)
|
||||
{
|
||||
JSObject* outer = js::ToWindowProxyIfWindow(obj);
|
||||
vp.setObject(*outer);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
@ -785,9 +785,6 @@ TryToOuterize(JSContext* cx, JS::MutableHandle<JS::Value> rval)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ObjectToOuterObjectValue(JSContext* cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
// Make sure to wrap the given string value into the right compartment, as
|
||||
// needed.
|
||||
MOZ_ALWAYS_INLINE
|
||||
|
Loading…
Reference in New Issue
Block a user