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

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

Issue 2880713002: Support combination of [OriginTrialEnabled] and [SecureContext] (Closed)
Patch Set: Rebase Created 3 years, 7 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 234
235 235
236 def filter_data_attributes(attributes): 236 def filter_data_attributes(attributes):
237 return [attribute for attribute in attributes if is_data_attribute(attribute ) and not is_lazy_data_attribute(attribute)] 237 return [attribute for attribute in attributes if is_data_attribute(attribute ) and not is_lazy_data_attribute(attribute)]
238 238
239 239
240 def filter_lazy_data_attributes(attributes): 240 def filter_lazy_data_attributes(attributes):
241 return [attribute for attribute in attributes if is_data_attribute(attribute ) and is_lazy_data_attribute(attribute)] 241 return [attribute for attribute in attributes if is_data_attribute(attribute ) and is_lazy_data_attribute(attribute)]
242 242
243 243
244 def filter_origin_trial_enabled(attributes):
245 return [attribute for attribute in attributes if
246 attribute['origin_trial_feature_name'] and
247 not attribute['exposed_test']]
248
249
250 def filter_runtime_enabled(attributes): 244 def filter_runtime_enabled(attributes):
251 return [attribute for attribute in attributes if 245 return [attribute for attribute in attributes if
252 not (attribute['exposed_test'] or 246 not (attribute['exposed_test'] or
253 attribute['secure_context_test']) and 247 attribute['secure_context_test']) and
254 attribute['runtime_enabled_feature_name']] 248 attribute['runtime_enabled_feature_name']]
255 249
256 250
251 def filter_conditionally_enabled(attributes):
252 return [attribute for attribute in attributes if
253 attribute['exposed_test'] or
254 (attribute['secure_context_test'] and
255 not attribute['origin_trial_feature_name'])]
256
257
257 ################################################################################ 258 ################################################################################
258 # Getter 259 # Getter
259 ################################################################################ 260 ################################################################################
260 261
261 def getter_context(interface, attribute, context): 262 def getter_context(interface, attribute, context):
262 idl_type = attribute.idl_type 263 idl_type = attribute.idl_type
263 base_idl_type = idl_type.base_type 264 base_idl_type = idl_type.base_type
264 extended_attributes = attribute.extended_attributes 265 extended_attributes = attribute.extended_attributes
265 266
266 cpp_value = getter_expression(interface, attribute, context) 267 cpp_value = getter_expression(interface, attribute, context)
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 def is_constructor_attribute(attribute): 572 def is_constructor_attribute(attribute):
572 return attribute.idl_type.name.endswith('Constructor') 573 return attribute.idl_type.name.endswith('Constructor')
573 574
574 575
575 def is_named_constructor_attribute(attribute): 576 def is_named_constructor_attribute(attribute):
576 return attribute.idl_type.name.endswith('ConstructorConstructor') 577 return attribute.idl_type.name.endswith('ConstructorConstructor')
577 578
578 579
579 def update_constructor_attribute_context(interface, attribute, context): 580 def update_constructor_attribute_context(interface, attribute, context):
580 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] 581 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as']
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698