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

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

Issue 1008353002: bindings: Reduces the binary size by reducing # of callback functions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 5 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 | « Source/bindings/core/v8/WrapperTypeInfo.h ('k') | 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/v8_attributes.py
diff --git a/Source/bindings/scripts/v8_attributes.py b/Source/bindings/scripts/v8_attributes.py
index 0b85ff8c7cd4b79f35b7f6f970c9e7fcd682ebe4..f5231347261aa3b6079f1796a14c09d60e03c000 100644
--- a/Source/bindings/scripts/v8_attributes.py
+++ b/Source/bindings/scripts/v8_attributes.py
@@ -141,7 +141,7 @@ def attribute_context(interface, attribute):
}
if is_constructor_attribute(attribute):
- constructor_getter_context(interface, attribute, context)
+ update_constructor_attribute_context(interface, attribute, context)
if not has_custom_getter(attribute):
getter_context(interface, attribute, context)
if not has_custom_setter(attribute) and has_setter(attribute):
@@ -517,5 +517,10 @@ def is_constructor_attribute(attribute):
return attribute.idl_type.name.endswith('Constructor')
-def constructor_getter_context(interface, attribute, context):
+def update_constructor_attribute_context(interface, attribute, context):
context['needs_constructor_getter_callback'] = context['measure_as'] or context['deprecate_as']
+ # When the attribute name is the same as the interface name, do not generate
+ # callback functions for each attribute and use
+ # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate
+ # a callback function in order to hard-code the attribute name.
+ context['needs_constructor_setter_callback'] = context['name'] != context['constructor_type']
« no previous file with comments | « Source/bindings/core/v8/WrapperTypeInfo.h ('k') | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698