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

Unified Diff: Source/bindings/scripts/unstable/v8_callback_interface.py

Issue 21006006: Add forEach() to CSSVariablesMap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase and review changes Created 7 years, 3 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 | « Source/bindings/scripts/code_generator_v8.pm ('k') | Source/bindings/scripts/unstable/v8_utilities.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/unstable/v8_callback_interface.py
diff --git a/Source/bindings/scripts/unstable/v8_callback_interface.py b/Source/bindings/scripts/unstable/v8_callback_interface.py
index c122daba42075e936f5fc4238ea98af9afc6c1da..fdbdfaa785412892fe7fac2a8949c2cb91b5bc16 100644
--- a/Source/bindings/scripts/unstable/v8_callback_interface.py
+++ b/Source/bindings/scripts/unstable/v8_callback_interface.py
@@ -36,7 +36,7 @@ For details, see bug http://crbug.com/239771
"""
from v8_types import cpp_type, cpp_value_to_v8_value, includes_for_type
-from v8_utilities import v8_class_name
+from v8_utilities import v8_class_name, has_extended_attribute_value
CALLBACK_INTERFACE_H_INCLUDES = set([
'bindings/v8/ActiveDOMCallback.h',
@@ -94,16 +94,18 @@ def includes_for_operation(operation):
def generate_method_contents(operation):
+ call_with_this_handle = has_extended_attribute_value(operation.extended_attributes, 'CallWith', 'ThisValue')
contents = {
'name': operation.name,
'return_cpp_type': cpp_type(operation.data_type, 'RefPtr'),
'custom': 'Custom' in operation.extended_attributes,
+ 'call_with_this_handle': call_with_this_handle,
}
- contents.update(generate_arguments_contents(operation.arguments))
+ contents.update(generate_arguments_contents(operation.arguments, call_with_this_handle))
return contents
-def generate_arguments_contents(arguments):
+def generate_arguments_contents(arguments, call_with_this_handle):
def argument_declaration(argument):
return '%s %s' % (cpp_type(argument.data_type), argument.name)
@@ -113,8 +115,11 @@ def generate_arguments_contents(arguments):
'cpp_to_v8_conversion': cpp_to_v8_conversion(argument.data_type, argument.name),
}
+ argument_declarations = [argument_declaration(argument) for argument in arguments]
+ if call_with_this_handle:
+ argument_declarations.insert(0, 'ScriptValue thisValue')
return {
- 'argument_declarations': [argument_declaration(argument) for argument in arguments],
+ 'argument_declarations': argument_declarations,
'arguments': [generate_argument(argument) for argument in arguments],
'handles': ['%sHandle' % argument.name for argument in arguments],
}
« no previous file with comments | « Source/bindings/scripts/code_generator_v8.pm ('k') | Source/bindings/scripts/unstable/v8_utilities.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698