Index: third_party/WebKit/Source/bindings/scripts/v8_callback_interface.py |
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_callback_interface.py b/third_party/WebKit/Source/bindings/scripts/v8_callback_interface.py |
index 8ceeb9a7a8282bec7e67539bf8bb8aa5af7a14ac..a3abad0b028f5bba2a27b9608b49ef1991521684 100644 |
--- a/third_party/WebKit/Source/bindings/scripts/v8_callback_interface.py |
+++ b/third_party/WebKit/Source/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 |