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

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

Issue 29153007: IDL compiler: [CallWith] for setters (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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 | « no previous file | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/unstable/v8_attributes.py
diff --git a/Source/bindings/scripts/unstable/v8_attributes.py b/Source/bindings/scripts/unstable/v8_attributes.py
index dd54594d776c6955a6c3d32369f00d8c5fb724c3..5964433461c8598711d0de051c06208705b707fc 100644
--- a/Source/bindings/scripts/unstable/v8_attributes.py
+++ b/Source/bindings/scripts/unstable/v8_attributes.py
@@ -148,13 +148,9 @@ def generate_attribute_and_includes(interface, attribute):
if not has_setter:
return contents, includes
- if v8_types.interface_type(idl_type) and not v8_types.array_type(idl_type):
- cpp_value = 'WTF::getPtr(cppValue)'
- else:
- cpp_value = 'cppValue'
contents.update({
'v8_value_to_local_cpp_value': v8_types.v8_value_to_local_cpp_value(idl_type, attribute.extended_attributes, 'jsValue', 'cppValue', includes, 'info.GetIsolate()'),
- 'cpp_setter': 'imp->set%s(%s)' % (capitalize(cpp_name(attribute)), cpp_value),
+ 'cpp_setter': setter_expression(attribute, contents),
})
return contents, includes
@@ -209,6 +205,15 @@ def content_attribute_getter_base_name(attribute, includes, arguments):
return 'fastGetAttribute'
+def setter_expression(attribute, contents):
+ arguments = v8_utilities.call_with_arguments(attribute, contents)
+ idl_type = attribute.data_type
+ # FIXME: should be able to eliminate WTF::getPtr in most or all cases
+ cpp_value = 'WTF::getPtr(cppValue)' if v8_types.interface_type(idl_type) and not v8_types.array_type(idl_type) else 'cppValue'
+ arguments.append(cpp_value)
+ return 'imp->set%s(%s)' % (capitalize(cpp_name(attribute)), ', '.join(arguments))
+
+
def is_keep_alive_for_gc(attribute):
idl_type = attribute.data_type
extended_attributes = attribute.extended_attributes
« no previous file with comments | « no previous file | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698