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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 Design doc: http://www.chromium.org/developers/design-documents/idl-compiler | 31 Design doc: http://www.chromium.org/developers/design-documents/idl-compiler |
32 """ | 32 """ |
33 | 33 |
34 import re | 34 import re |
35 | 35 |
36 from idl_types import IdlTypeBase | 36 from idl_types import IdlTypeBase |
37 import idl_types | 37 import idl_types |
38 from idl_definitions import Exposure, IdlInterface | 38 from idl_definitions import Exposure, IdlInterface |
39 from v8_globals import includes | 39 from v8_globals import includes |
40 import v8_types | |
41 | 40 |
42 ACRONYMS = [ | 41 ACRONYMS = [ |
43 'CSSOM', # must come *before* CSS to match full acronym | 42 'CSSOM', # must come *before* CSS to match full acronym |
44 'CSS', | 43 'CSS', |
45 'HTML', | 44 'HTML', |
46 'IME', | 45 'IME', |
47 'JS', | 46 'JS', |
48 'SVG', | 47 'SVG', |
49 'URL', | 48 'URL', |
50 'WOFF', | 49 'WOFF', |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 partial_interface_implemented_as = definition.extended_attributes.get('Parti
alInterfaceImplementedAs') | 124 partial_interface_implemented_as = definition.extended_attributes.get('Parti
alInterfaceImplementedAs') |
126 if partial_interface_implemented_as: | 125 if partial_interface_implemented_as: |
127 return '%s::%s' % (partial_interface_implemented_as, base_name) | 126 return '%s::%s' % (partial_interface_implemented_as, base_name) |
128 if (definition.is_static or | 127 if (definition.is_static or |
129 definition.name in ('Constructor', 'NamedConstructor')): | 128 definition.name in ('Constructor', 'NamedConstructor')): |
130 return '%s::%s' % (cpp_name(interface), base_name) | 129 return '%s::%s' % (cpp_name(interface), base_name) |
131 return 'impl->%s' % base_name | 130 return 'impl->%s' % base_name |
132 | 131 |
133 | 132 |
134 def v8_class_name(interface): | 133 def v8_class_name(interface): |
135 return v8_types.v8_type(interface.name) | 134 return 'V8' + interface.name |
136 | 135 |
137 | 136 |
138 def v8_class_name_or_partial(interface): | 137 def v8_class_name_or_partial(interface): |
139 class_name = v8_class_name(interface) | 138 class_name = v8_class_name(interface) |
140 if interface.is_partial: | 139 if interface.is_partial: |
141 return ''.join([class_name, 'Partial']) | 140 return ''.join([class_name, 'Partial']) |
142 return class_name | 141 return class_name |
143 | 142 |
144 | 143 |
145 ################################################################################ | 144 ################################################################################ |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 except StopIteration: | 498 except StopIteration: |
500 return None | 499 return None |
501 | 500 |
502 | 501 |
503 IdlInterface.indexed_property_getter = property(indexed_property_getter) | 502 IdlInterface.indexed_property_getter = property(indexed_property_getter) |
504 IdlInterface.indexed_property_setter = property(indexed_property_setter) | 503 IdlInterface.indexed_property_setter = property(indexed_property_setter) |
505 IdlInterface.indexed_property_deleter = property(indexed_property_deleter) | 504 IdlInterface.indexed_property_deleter = property(indexed_property_deleter) |
506 IdlInterface.named_property_getter = property(named_property_getter) | 505 IdlInterface.named_property_getter = property(named_property_getter) |
507 IdlInterface.named_property_setter = property(named_property_setter) | 506 IdlInterface.named_property_setter = property(named_property_setter) |
508 IdlInterface.named_property_deleter = property(named_property_deleter) | 507 IdlInterface.named_property_deleter = property(named_property_deleter) |
OLD | NEW |