Skip to content

Commit

Permalink
Give WindowProxy objects an innerObject hook.
Browse files Browse the repository at this point in the history
This ensures that UncheckedUnwrap(obj, /* stopAtOuter = */ true) will indeed
stop at the WindowProxy ("outer window", in older SpiderMonkey jargon), which
is necessary to prevent raw Window ("inner window") objects becoming visible
to JavaScript code, or tripping assertions that we don't do that.
  • Loading branch information
Ms2ger committed Feb 9, 2016
1 parent 7042315 commit d79660e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions components/script/dom/browsingcontext.rs
Expand Up @@ -12,7 +12,7 @@ use dom::document::Document;
use dom::element::Element;
use dom::window::Window;
use js::JSCLASS_IS_GLOBAL;
use js::glue::{CreateWrapperProxyHandler, ProxyTraps, WrapperNew};
use js::glue::{CreateWrapperProxyHandler, ProxyTraps, NewWindowProxy};
use js::glue::{GetProxyPrivate, SetProxyExtra};
use js::jsapi::{Handle, JS_ForwardSetPropertyTo, ObjectOpResult, RootedObject, RootedValue};
use js::jsapi::{HandleId, HandleObject, MutableHandle, MutableHandleValue};
Expand Down Expand Up @@ -56,11 +56,7 @@ impl BrowsingContext {
assert!(((*JS_GetClass(parent.get())).flags & JSCLASS_IS_GLOBAL) != 0);
let _ac = JSAutoCompartment::new(cx, parent.get());
let window_proxy = RootedObject::new(cx,
WrapperNew(cx,
parent,
handler,
ptr::null(),
true));
NewWindowProxy(cx, parent, handler));
assert!(!window_proxy.ptr.is_null());

let object = box BrowsingContext::new_inherited(document, frame_element);
Expand Down
2 changes: 1 addition & 1 deletion components/servo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ports/cef/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ports/gonk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d79660e

Please sign in to comment.