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

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

Issue 2106983002: Allow origin trials to be declared on IDL operations (methods) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing unneeded includes, addressing nits 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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 """ 393 """
394 extended_attributes = definition_or_member.extended_attributes 394 extended_attributes = definition_or_member.extended_attributes
395 is_origin_trial_enabled = 'OriginTrialEnabled' in extended_attributes 395 is_origin_trial_enabled = 'OriginTrialEnabled' in extended_attributes
396 396
397 if (is_origin_trial_enabled and 'RuntimeEnabled' in extended_attributes): 397 if (is_origin_trial_enabled and 'RuntimeEnabled' in extended_attributes):
398 raise Exception('[OriginTrialEnabled] and [RuntimeEnabled] must ' 398 raise Exception('[OriginTrialEnabled] and [RuntimeEnabled] must '
399 'not be specified on the same definition: ' 399 'not be specified on the same definition: '
400 '%s.%s' % (definition_or_member.idl_name, definition_or_ member.name)) 400 '%s.%s' % (definition_or_member.idl_name, definition_or_ member.name))
401 401
402 if is_origin_trial_enabled: 402 if is_origin_trial_enabled:
403 includes.add('bindings/core/v8/ScriptState.h')
404 includes.add('core/origin_trials/OriginTrials.h')
405
406 trial_name = extended_attributes['OriginTrialEnabled'] 403 trial_name = extended_attributes['OriginTrialEnabled']
407 return 'OriginTrials::%sEnabled' % uncapitalize(trial_name) 404 return 'OriginTrials::%sEnabled' % uncapitalize(trial_name)
408 405
409 return None 406 return None
410 407
411 408
412 def origin_trial_feature_name(definition_or_member): 409 def origin_trial_feature_name(definition_or_member):
413 extended_attributes = definition_or_member.extended_attributes 410 extended_attributes = definition_or_member.extended_attributes
414 if 'OriginTrialEnabled' not in extended_attributes: 411 if 'OriginTrialEnabled' not in extended_attributes:
415 return None 412 return None
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 except StopIteration: 623 except StopIteration:
627 return None 624 return None
628 625
629 626
630 IdlInterface.indexed_property_getter = property(indexed_property_getter) 627 IdlInterface.indexed_property_getter = property(indexed_property_getter)
631 IdlInterface.indexed_property_setter = property(indexed_property_setter) 628 IdlInterface.indexed_property_setter = property(indexed_property_setter)
632 IdlInterface.indexed_property_deleter = property(indexed_property_deleter) 629 IdlInterface.indexed_property_deleter = property(indexed_property_deleter)
633 IdlInterface.named_property_getter = property(named_property_getter) 630 IdlInterface.named_property_getter = property(named_property_getter)
634 IdlInterface.named_property_setter = property(named_property_setter) 631 IdlInterface.named_property_setter = property(named_property_setter)
635 IdlInterface.named_property_deleter = property(named_property_deleter) 632 IdlInterface.named_property_deleter = property(named_property_deleter)
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/scripts/v8_methods.py ('k') | third_party/WebKit/Source/bindings/templates/interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698