diff options
author | marmeladema <xademax@gmail.com> | 2019-07-22 22:14:11 +0100 |
---|---|---|
committer | marmeladema <xademax@gmail.com> | 2019-07-24 09:53:10 +0100 |
commit | 88cacfb0098e20be70c27bfde6b74cd3290f1fe4 (patch) | |
tree | 95d7cd9ffad7eaff05114946a1e12f8e49d55fab /components/script/dom/bindings/htmlconstructor.rs | |
parent | 2c5d0a6ebc39ad263e2bbe623e357a11b4cec5aa (diff) | |
download | servo-88cacfb0098e20be70c27bfde6b74cd3290f1fe4.tar.gz servo-88cacfb0098e20be70c27bfde6b74cd3290f1fe4.zip |
Modify *::get_cx methods to return a safe JSContext instead of a raw one
Diffstat (limited to 'components/script/dom/bindings/htmlconstructor.rs')
-rw-r--r-- | components/script/dom/bindings/htmlconstructor.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/dom/bindings/htmlconstructor.rs b/components/script/dom/bindings/htmlconstructor.rs index f976a09ee91..6faa4f6211c 100644 --- a/components/script/dom/bindings/htmlconstructor.rs +++ b/components/script/dom/bindings/htmlconstructor.rs @@ -100,7 +100,7 @@ where // Step 2 is checked in the generated caller code // Step 3 - rooted!(in(window.get_cx()) let new_target = call_args.new_target().to_object()); + rooted!(in(*window.get_cx()) let new_target = call_args.new_target().to_object()); let definition = match registry.lookup_definition_by_constructor(new_target.handle()) { Some(definition) => definition, None => { @@ -110,15 +110,15 @@ where }, }; - rooted!(in(window.get_cx()) let callee = UnwrapObjectStatic(call_args.callee())); + rooted!(in(*window.get_cx()) let callee = UnwrapObjectStatic(call_args.callee())); if callee.is_null() { return Err(Error::Security); } { - let _ac = JSAutoRealm::new(window.get_cx(), callee.get()); - rooted!(in(window.get_cx()) let mut constructor = ptr::null_mut::<JSObject>()); - rooted!(in(window.get_cx()) let global_object = CurrentGlobalOrNull(window.get_cx())); + let _ac = JSAutoRealm::new(*window.get_cx(), callee.get()); + rooted!(in(*window.get_cx()) let mut constructor = ptr::null_mut::<JSObject>()); + rooted!(in(*window.get_cx()) let global_object = CurrentGlobalOrNull(*window.get_cx())); if definition.is_autonomous() { // Step 4 @@ -126,7 +126,7 @@ where // Retrieve the constructor object for HTMLElement HTMLElementBinding::GetConstructorObject( - SafeJSContext::from_ptr(window.get_cx()), + window.get_cx(), global_object.handle(), constructor.handle_mut(), ); @@ -134,7 +134,7 @@ where // Step 5 get_constructor_object_from_local_name( definition.local_name.clone(), - window.get_cx(), + *window.get_cx(), global_object.handle(), constructor.handle_mut(), ); |