Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 16 matching lines...) Expand all Loading... | |
| 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 """Generate template values for methods. | 29 """Generate template values for methods. |
| 30 | 30 |
| 31 Extends IdlType and IdlUnionType with property |union_arguments|. | 31 Extends IdlType and IdlUnionType with property |union_arguments|. |
| 32 | 32 |
| 33 Design doc: http://www.chromium.org/developers/design-documents/idl-compiler | 33 Design doc: http://www.chromium.org/developers/design-documents/idl-compiler |
| 34 """ | 34 """ |
| 35 | 35 |
| 36 from idl_definitions import IdlArgument | 36 from idl_definitions import IdlArgument |
| 37 from idl_types import IdlType, IdlUnionType, inherits_interface | 37 from idl_types import IdlTypeBase, IdlType, IdlUnionType, inherits_interface |
|
Nils Barth (inactive)
2014/08/14 13:55:00
Don't need IdlType here any longer.
Jens Widell
2014/08/14 13:59:20
Done.
| |
| 38 from v8_globals import includes | 38 from v8_globals import includes |
| 39 import v8_types | 39 import v8_types |
| 40 import v8_utilities | 40 import v8_utilities |
| 41 from v8_utilities import has_extended_attribute_value | 41 from v8_utilities import has_extended_attribute_value |
| 42 | 42 |
| 43 | 43 |
| 44 # Methods with any of these require custom method registration code in the | 44 # Methods with any of these require custom method registration code in the |
| 45 # interface's configure*Template() function. | 45 # interface's configure*Template() function. |
| 46 CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES = frozenset([ | 46 CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES = frozenset([ |
| 47 'DoNotCheckSecurity', | 47 'DoNotCheckSecurity', |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 405 return [arg | 405 return [arg |
| 406 for i in range(len(idl_type.member_types)) | 406 for i in range(len(idl_type.member_types)) |
| 407 for arg in ['result%sEnabled' % i, 'result%s' % i]] | 407 for arg in ['result%sEnabled' % i, 'result%s' % i]] |
| 408 | 408 |
| 409 | 409 |
| 410 def argument_default_cpp_value(argument): | 410 def argument_default_cpp_value(argument): |
| 411 if not argument.default_value: | 411 if not argument.default_value: |
| 412 return None | 412 return None |
| 413 return argument.idl_type.literal_cpp_value(argument.default_value) | 413 return argument.idl_type.literal_cpp_value(argument.default_value) |
| 414 | 414 |
| 415 IdlType.union_arguments = property(lambda self: None) | 415 IdlTypeBase.union_arguments = None |
| 416 IdlUnionType.union_arguments = property(union_arguments) | 416 IdlUnionType.union_arguments = property(union_arguments) |
| 417 IdlArgument.default_cpp_value = property(argument_default_cpp_value) | 417 IdlArgument.default_cpp_value = property(argument_default_cpp_value) |
| OLD | NEW |