aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/compartments.rs7
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py2
2 files changed, 5 insertions, 4 deletions
diff --git a/components/script/compartments.rs b/components/script/compartments.rs
index c26e72ccd1a..7b45f38c56a 100644
--- a/components/script/compartments.rs
+++ b/components/script/compartments.rs
@@ -4,7 +4,8 @@
use crate::dom::bindings::reflector::DomObject;
use crate::dom::globalscope::GlobalScope;
-use js::jsapi::{GetCurrentRealmOrNull, JSAutoRealm, JSContext};
+use crate::script_runtime::JSContext;
+use js::jsapi::{GetCurrentRealmOrNull, JSAutoRealm};
pub struct AlreadyInCompartment(());
@@ -17,9 +18,9 @@ impl AlreadyInCompartment {
AlreadyInCompartment(())
}
- pub fn assert_for_cx(cx: *mut JSContext) -> AlreadyInCompartment {
+ pub fn assert_for_cx(cx: JSContext) -> AlreadyInCompartment {
unsafe {
- assert!(!GetCurrentRealmOrNull(cx).is_null());
+ assert!(!GetCurrentRealmOrNull(*cx).is_null());
}
AlreadyInCompartment(())
}
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 49402ade3c7..7daa7c2fd68 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -3335,7 +3335,7 @@ class CGCallGenerator(CGThing):
if "cx" not in argsPre and needsCx:
args.prepend(CGGeneric("cx"))
if nativeMethodName in descriptor.inCompartmentMethods:
- args.append(CGGeneric("InCompartment::in_compartment(&AlreadyInCompartment::assert_for_cx(*cx))"))
+ args.append(CGGeneric("InCompartment::in_compartment(&AlreadyInCompartment::assert_for_cx(cx))"))
# Build up our actual call
self.cgRoot = CGList([], "\n")