aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
authormarmeladema <xademax@gmail.com>2019-07-20 15:34:26 +0100
committermarmeladema <xademax@gmail.com>2019-07-24 08:18:20 +0100
commitcd0eb88a3e4077590ff9419399d8226c1694de5b (patch)
treed15a4532d9e8a731369fb955187c7a683f1d2b16 /components/script/dom/bindings/codegen/CodegenRust.py
parentdbcd8d7af232cd10c3a8ef751076cc7b9cd068a4 (diff)
downloadservo-cd0eb88a3e4077590ff9419399d8226c1694de5b.tar.gz
servo-cd0eb88a3e4077590ff9419399d8226c1694de5b.zip
ConstructorEnabled now takes a SafeJSContext instead of a JSContext
a first argument. The function cannot be made safe because of call to unsafe function is_exposed_in.
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index e0c7725fa52..6f70e5e64f1 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -2586,7 +2586,7 @@ class CGConstructorEnabled(CGAbstractMethod):
def __init__(self, descriptor):
CGAbstractMethod.__init__(self, descriptor,
'ConstructorEnabled', 'bool',
- [Argument("*mut JSContext", "aCx"),
+ [Argument("SafeJSContext", "aCx"),
Argument("HandleObject", "aObj")],
unsafe=True)
@@ -3285,7 +3285,7 @@ class CGDefineDOMInterfaceMethod(CGAbstractMethod):
return CGGeneric("""\
assert!(!global.get().is_null());
-if !ConstructorEnabled(cx, global) {
+if !ConstructorEnabled(SafeJSContext::from_ptr(cx), global) {
return;
}
@@ -6006,6 +6006,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
'crate::mem::malloc_size_of_including_raw_self',
'crate::compartments::InCompartment',
'crate::compartments::AlreadyInCompartment',
+ 'crate::script_runtime::JSContext as SafeJSContext',
'libc',
'servo_config::pref',
'servo_config::prefs',