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

Unified Diff: Source/bindings/templates/attributes.cpp

Issue 1008353002: bindings: Reduces the binary size by reducing # of callback functions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed a review comment. 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
Index: Source/bindings/templates/attributes.cpp
diff --git a/Source/bindings/templates/attributes.cpp b/Source/bindings/templates/attributes.cpp
index 5577e9946e33a12c009ed25cd319d791dca1a3cf..27c7a5d31e70569c9faaf75104ae79a0ff105296 100644
--- a/Source/bindings/templates/attributes.cpp
+++ b/Source/bindings/templates/attributes.cpp
@@ -419,9 +419,19 @@ bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeSetter(LocalFrame*
(cpp_class_or_partial, attribute.name)
if attribute.is_per_world_bindings else '0' %}
{% set setter_callback =
+ '0' if not attribute.has_setter else (
+ '%sV8Internal::%sConstructorAttributeSetterCallbackAsProperty' %
+ (cpp_class_or_partial, cpp_class)
+ if (attribute.constructor_type and
+ attribute.name == attribute.constructor_type and
+ not attribute.is_expose_js_accessors) else (
+ '%sV8Internal::%sConstructorAttributeSetterCallbackAsAccessor' %
+ (cpp_class_or_partial, cpp_class)
+ if (attribute.constructor_type and
+ attribute.name == attribute.constructor_type and
+ attribute.is_expose_js_accessors) else (
haraken 2015/03/17 00:06:07 Can we clean up these branches somehow? It looks t
Yuki 2015/03/17 08:35:19 Tried my best.
'%sV8Internal::%sAttributeSetterCallback' %
- (cpp_class_or_partial, attribute.name)
- if attribute.has_setter else '0' %}
+ (cpp_class_or_partial, attribute.name)))) %}
{% set setter_callback_for_main_world =
'%sV8Internal::%sAttributeSetterCallbackForMainWorld' %
(cpp_class_or_partial, attribute.name)

Powered by Google App Engine
This is Rietveld 408576698