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: third_party/WebKit/Source/bindings/scripts/v8_utilities.py

Issue 2005433002: [Origin Trials] Install origin trial bindings on V8 context conditionally (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-ef-install
Patch Set: Fix multiple definition of signature; addressing nits Created 4 years, 6 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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 """ 386 """
387 extended_attributes = definition_or_member.extended_attributes 387 extended_attributes = definition_or_member.extended_attributes
388 is_origin_trial_enabled = 'OriginTrialEnabled' in extended_attributes 388 is_origin_trial_enabled = 'OriginTrialEnabled' in extended_attributes
389 389
390 if (is_origin_trial_enabled and 'RuntimeEnabled' in extended_attributes): 390 if (is_origin_trial_enabled and 'RuntimeEnabled' in extended_attributes):
391 raise Exception('[OriginTrialEnabled] and [RuntimeEnabled] must ' 391 raise Exception('[OriginTrialEnabled] and [RuntimeEnabled] must '
392 'not be specified on the same definition: ' 392 'not be specified on the same definition: '
393 '%s.%s' % (definition_or_member.idl_name, definition_or_ member.name)) 393 '%s.%s' % (definition_or_member.idl_name, definition_or_ member.name))
394 394
395 if is_origin_trial_enabled: 395 if is_origin_trial_enabled:
396 includes.add('core/inspector/ConsoleMessage.h') 396 includes.add('bindings/core/v8/ScriptState.h')
397 includes.add('core/origin_trials/OriginTrials.h') 397 includes.add('core/origin_trials/OriginTrials.h')
398 398
399 trial_name = extended_attributes['OriginTrialEnabled'] 399 trial_name = extended_attributes['OriginTrialEnabled']
400 return 'OriginTrials::%sEnabled' % uncapitalize(trial_name) 400 return 'OriginTrials::%sEnabled' % uncapitalize(trial_name)
401 401
402 return None 402 return None
403 403
404 404
405 def origin_trial_feature_name(definition_or_member):
406 extended_attributes = definition_or_member.extended_attributes
407 if 'OriginTrialEnabled' not in extended_attributes:
408 return None
409 return extended_attributes['OriginTrialEnabled']
410
411
405 def runtime_feature_name(definition_or_member): 412 def runtime_feature_name(definition_or_member):
406 extended_attributes = definition_or_member.extended_attributes 413 extended_attributes = definition_or_member.extended_attributes
407 if 'RuntimeEnabled' not in extended_attributes: 414 if 'RuntimeEnabled' not in extended_attributes:
408 return None 415 return None
409 return extended_attributes['RuntimeEnabled'] 416 return extended_attributes['RuntimeEnabled']
410 417
411 418
412 # [RuntimeEnabled] 419 # [RuntimeEnabled]
413 def runtime_enabled_function_name(definition_or_member): 420 def runtime_enabled_function_name(definition_or_member):
414 """Returns the name of the RuntimeEnabledFeatures function. 421 """Returns the name of the RuntimeEnabledFeatures function.
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 except StopIteration: 619 except StopIteration:
613 return None 620 return None
614 621
615 622
616 IdlInterface.indexed_property_getter = property(indexed_property_getter) 623 IdlInterface.indexed_property_getter = property(indexed_property_getter)
617 IdlInterface.indexed_property_setter = property(indexed_property_setter) 624 IdlInterface.indexed_property_setter = property(indexed_property_setter)
618 IdlInterface.indexed_property_deleter = property(indexed_property_deleter) 625 IdlInterface.indexed_property_deleter = property(indexed_property_deleter)
619 IdlInterface.named_property_getter = property(named_property_getter) 626 IdlInterface.named_property_getter = property(named_property_getter)
620 IdlInterface.named_property_setter = property(named_property_setter) 627 IdlInterface.named_property_setter = property(named_property_setter)
621 IdlInterface.named_property_deleter = property(named_property_deleter) 628 IdlInterface.named_property_deleter = property(named_property_deleter)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698