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

Side by Side Diff: Source/bindings/scripts/v8_attributes.py

Issue 186673002: Support deprecation + use counters for constructor attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Renamings Created 6 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
« no previous file with comments | « no previous file | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 if 'ReflectOnly' in extended_attributes else None, 130 if 'ReflectOnly' in extended_attributes else None,
131 'setter_callback': setter_callback_name(interface, attribute), 131 'setter_callback': setter_callback_name(interface, attribute),
132 'v8_type': v8_types.v8_type(idl_type), 132 'v8_type': v8_types.v8_type(idl_type),
133 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(a ttribute), # [RuntimeEnabled] 133 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(a ttribute), # [RuntimeEnabled]
134 'world_suffixes': ['', 'ForMainWorld'] 134 'world_suffixes': ['', 'ForMainWorld']
135 if 'PerWorldBindings' in extended_attributes 135 if 'PerWorldBindings' in extended_attributes
136 else [''], # [PerWorldBindings] 136 else [''], # [PerWorldBindings]
137 } 137 }
138 138
139 if is_constructor_attribute(attribute): 139 if is_constructor_attribute(attribute):
140 generate_constructor_getter(interface, attribute, contents)
140 return contents 141 return contents
141 if not has_custom_getter: 142 if not has_custom_getter:
142 generate_getter(interface, attribute, contents) 143 generate_getter(interface, attribute, contents)
143 if (not has_custom_setter and 144 if (not has_custom_setter and
144 (not attribute.is_read_only or 'PutForwards' in extended_attributes)): 145 (not attribute.is_read_only or 'PutForwards' in extended_attributes)):
145 generate_setter(interface, attribute, contents) 146 generate_setter(interface, attribute, contents)
146 147
147 return contents 148 return contents
148 149
149 150
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 property_attributes_list.append('v8::DontDelete') 390 property_attributes_list.append('v8::DontDelete')
390 return property_attributes_list or ['v8::None'] 391 return property_attributes_list or ['v8::None']
391 392
392 393
393 ################################################################################ 394 ################################################################################
394 # Constructors 395 # Constructors
395 ################################################################################ 396 ################################################################################
396 397
397 def is_constructor_attribute(attribute): 398 def is_constructor_attribute(attribute):
398 return attribute.idl_type.endswith('Constructor') 399 return attribute.idl_type.endswith('Constructor')
400
401
402 def generate_constructor_getter(interface, attribute, contents):
403 contents['needs_constructor_getter_callback'] = contents['measure_as'] or co ntents['deprecate_as']
OLDNEW
« 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