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

Unified Diff: third_party/WebKit/Source/bindings/scripts/v8_callback_interface.py

Issue 1455883003: bindings: Pass dictionaries to callback methods by const reference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698