From cd0eb88a3e4077590ff9419399d8226c1694de5b Mon Sep 17 00:00:00 2001 From: marmeladema Date: Sat, 20 Jul 2019 15:34:26 +0100 Subject: 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. --- components/script/dom/bindings/codegen/CodegenRust.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'components/script/dom/bindings/codegen/CodegenRust.py') 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', -- cgit v1.2.3