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

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

Issue 900533003: IDL: Support [Unforgeable] on interface definitions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 Given extended attribute RuntimeEnabled=FeatureName, return: 394 Given extended attribute RuntimeEnabled=FeatureName, return:
395 RuntimeEnabledFeatures::{featureName}Enabled 395 RuntimeEnabledFeatures::{featureName}Enabled
396 """ 396 """
397 extended_attributes = definition_or_member.extended_attributes 397 extended_attributes = definition_or_member.extended_attributes
398 if 'RuntimeEnabled' not in extended_attributes: 398 if 'RuntimeEnabled' not in extended_attributes:
399 return None 399 return None
400 feature_name = extended_attributes['RuntimeEnabled'] 400 feature_name = extended_attributes['RuntimeEnabled']
401 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) 401 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name)
402 402
403 403
404 # [Unforgeable]
405 def is_unforgeable(interface, member):
406 return ('Unforgeable' in interface.extended_attributes or
407 'Unforgeable' in member.extended_attributes)
408
409
404 ################################################################################ 410 ################################################################################
405 # Indexed properties 411 # Indexed properties
406 # http://heycam.github.io/webidl/#idl-indexed-properties 412 # http://heycam.github.io/webidl/#idl-indexed-properties
407 ################################################################################ 413 ################################################################################
408 414
409 def indexed_property_getter(interface): 415 def indexed_property_getter(interface):
410 try: 416 try:
411 # Find indexed property getter, if present; has form: 417 # Find indexed property getter, if present; has form:
412 # getter TYPE [OPTIONAL_IDENTIFIER](unsigned long ARG1) 418 # getter TYPE [OPTIONAL_IDENTIFIER](unsigned long ARG1)
413 return next( 419 return next(
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 except StopIteration: 502 except StopIteration:
497 return None 503 return None
498 504
499 505
500 IdlInterface.indexed_property_getter = property(indexed_property_getter) 506 IdlInterface.indexed_property_getter = property(indexed_property_getter)
501 IdlInterface.indexed_property_setter = property(indexed_property_setter) 507 IdlInterface.indexed_property_setter = property(indexed_property_setter)
502 IdlInterface.indexed_property_deleter = property(indexed_property_deleter) 508 IdlInterface.indexed_property_deleter = property(indexed_property_deleter)
503 IdlInterface.named_property_getter = property(named_property_getter) 509 IdlInterface.named_property_getter = property(named_property_getter)
504 IdlInterface.named_property_setter = property(named_property_setter) 510 IdlInterface.named_property_setter = property(named_property_setter)
505 IdlInterface.named_property_deleter = property(named_property_deleter) 511 IdlInterface.named_property_deleter = property(named_property_deleter)
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_methods.py ('k') | Source/bindings/tests/idls/core/TestInterfaceWillBeGarbageCollected.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698