Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Unified Diff: bindings/scripts/v8_callback_interface.py

Issue 2786203002: Roll 50: Copied IDLs, PYTHON scripts from WebKit removed deleted files in WebCore (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bindings/scripts/v8_attributes.py ('k') | bindings/scripts/v8_dictionary.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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),
« no previous file with comments | « bindings/scripts/v8_attributes.py ('k') | bindings/scripts/v8_dictionary.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698