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

Side by Side 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: Addressed review comments. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 'reflect_missing': extended_attributes.get('ReflectMissing'), 134 'reflect_missing': extended_attributes.get('ReflectMissing'),
135 'reflect_only': extended_attribute_value_as_list(attribute, 'ReflectOnly '), 135 'reflect_only': extended_attribute_value_as_list(attribute, 'ReflectOnly '),
136 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(a ttribute), # [RuntimeEnabled] 136 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(a ttribute), # [RuntimeEnabled]
137 'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script), 137 'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script),
138 'world_suffixes': ['', 'ForMainWorld'] 138 'world_suffixes': ['', 'ForMainWorld']
139 if 'PerWorldBindings' in extended_attributes 139 if 'PerWorldBindings' in extended_attributes
140 else [''], # [PerWorldBindings] 140 else [''], # [PerWorldBindings]
141 } 141 }
142 142
143 if is_constructor_attribute(attribute): 143 if is_constructor_attribute(attribute):
144 constructor_getter_context(interface, attribute, context) 144 update_constructor_attribute_context(interface, attribute, context)
145 if not has_custom_getter(attribute): 145 if not has_custom_getter(attribute):
146 getter_context(interface, attribute, context) 146 getter_context(interface, attribute, context)
147 if not has_custom_setter(attribute) and has_setter(attribute): 147 if not has_custom_setter(attribute) and has_setter(attribute):
148 setter_context(interface, attribute, context) 148 setter_context(interface, attribute, context)
149 149
150 return context 150 return context
151 151
152 152
153 ################################################################################ 153 ################################################################################
154 # Getter 154 # Getter
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 idl_types.IdlType.constructor_type_name = property( 510 idl_types.IdlType.constructor_type_name = property(
511 # FIXME: replace this with a [ConstructorAttribute] extended attribute 511 # FIXME: replace this with a [ConstructorAttribute] extended attribute
512 lambda self: strip_suffix(self.base_type, 'Constructor')) 512 lambda self: strip_suffix(self.base_type, 'Constructor'))
513 513
514 514
515 def is_constructor_attribute(attribute): 515 def is_constructor_attribute(attribute):
516 # FIXME: replace this with [ConstructorAttribute] extended attribute 516 # FIXME: replace this with [ConstructorAttribute] extended attribute
517 return attribute.idl_type.name.endswith('Constructor') 517 return attribute.idl_type.name.endswith('Constructor')
518 518
519 519
520 def constructor_getter_context(interface, attribute, context): 520 def update_constructor_attribute_context(interface, attribute, context):
521 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] 521 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as']
522 context['needs_constructor_setter_callback'] = context['name'] != context['c onstructor_type']
haraken 2015/03/17 08:48:07 Can we add a comment and mention why we need to ch
Yuki 2015/03/17 09:10:05 Done.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698