Index: bindings/scripts/v8_callback_interface.py |
diff --git a/bindings/scripts/v8_callback_interface.py b/bindings/scripts/v8_callback_interface.py |
index 8ceeb9a7a8282bec7e67539bf8bb8aa5af7a14ac..682cb55e27227428754bad68161a7c32e0de3a59 100644 |
--- a/bindings/scripts/v8_callback_interface.py |
+++ b/bindings/scripts/v8_callback_interface.py |
@@ -63,7 +63,8 @@ def cpp_type(idl_type): |
return 'void' |
# Callbacks use raw pointers, so raw_type=True |
raw_cpp_type = idl_type.cpp_type_args(raw_type=True) |
- if raw_cpp_type.startswith(('Vector', 'HeapVector', 'WillBeHeapVector')): |
+ # Pass containers and dictionaries to callback method by const reference rather than by value |
+ if raw_cpp_type.startswith(('Vector', 'HeapVector', 'WillBeHeapVector')) or idl_type.is_dictionary: |
return 'const %s&' % raw_cpp_type |
return raw_cpp_type |
@@ -74,7 +75,6 @@ def callback_interface_context(callback_interface): |
includes.clear() |
includes.update(CALLBACK_INTERFACE_CPP_INCLUDES) |
return { |
- 'conditional_string': v8_utilities.conditional_string(callback_interface), |
'cpp_class': callback_interface.name, |
'v8_class': v8_utilities.v8_class_name(callback_interface), |
'header_includes': set(CALLBACK_INTERFACE_H_INCLUDES), |