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

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

Issue 2116533003: [Origin Trials] Allow static attributes to be defined on origin trials (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix it harder Created 4 years, 5 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
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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 else ['']), # [PerWorldBindings] 175 else ['']), # [PerWorldBindings]
176 } 176 }
177 177
178 if is_constructor_attribute(attribute): 178 if is_constructor_attribute(attribute):
179 update_constructor_attribute_context(interface, attribute, context) 179 update_constructor_attribute_context(interface, attribute, context)
180 if not has_custom_getter(attribute): 180 if not has_custom_getter(attribute):
181 getter_context(interface, attribute, context) 181 getter_context(interface, attribute, context)
182 if not has_custom_setter(attribute) and has_setter(interface, attribute): 182 if not has_custom_setter(attribute) and has_setter(interface, attribute):
183 setter_context(interface, attribute, context) 183 setter_context(interface, attribute, context)
184 184
185 # [OriginTrialEnabled]
186 # TODO(iclelland): Allow origin trials on static interfaces
187 # (crbug.com/614352)
188 if context['origin_trial_feature_name'] and context['on_interface']:
189 raise Exception('[OriginTrialEnabled] cannot be specified on static '
190 'attributes: %s.%s' % (interface.name, attribute.name))
191
192 return context 185 return context
193 186
194 187
195 def filter_has_accessor_configuration(attributes): 188 def filter_has_accessor_configuration(attributes):
196 return [attribute for attribute in attributes if 189 return [attribute for attribute in attributes if
197 not (attribute['exposed_test'] or 190 not (attribute['exposed_test'] or
198 attribute['origin_trial_enabled_function'] or 191 attribute['origin_trial_enabled_function'] or
199 attribute['runtime_enabled_function']) and 192 attribute['runtime_enabled_function']) and
200 not attribute['is_data_type_property'] and 193 not attribute['is_data_type_property'] and
201 attribute['should_be_exposed_to_script']] 194 attribute['should_be_exposed_to_script']]
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 lambda self: strip_suffix(self.base_type, 'Constructor')) 564 lambda self: strip_suffix(self.base_type, 'Constructor'))
572 565
573 566
574 def is_constructor_attribute(attribute): 567 def is_constructor_attribute(attribute):
575 # FIXME: replace this with [ConstructorAttribute] extended attribute 568 # FIXME: replace this with [ConstructorAttribute] extended attribute
576 return attribute.idl_type.name.endswith('Constructor') 569 return attribute.idl_type.name.endswith('Constructor')
577 570
578 571
579 def update_constructor_attribute_context(interface, attribute, context): 572 def update_constructor_attribute_context(interface, attribute, context):
580 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] 573 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as']
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698