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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 # FIXME: Add IdlEnumType, move property to derived type, and remove this che
ck | 111 # FIXME: Add IdlEnumType, move property to derived type, and remove this che
ck |
112 if not idl_type.is_enum: | 112 if not idl_type.is_enum: |
113 return None | 113 return None |
114 return ' || '.join(['string == "%s"' % enum_value | 114 return ' || '.join(['string == "%s"' % enum_value |
115 for enum_value in idl_type.enum_values]) | 115 for enum_value in idl_type.enum_values]) |
116 IdlType.enum_validation_expression = property(enum_validation_expression) | 116 IdlType.enum_validation_expression = property(enum_validation_expression) |
117 | 117 |
118 | 118 |
119 def scoped_name(interface, definition, base_name): | 119 def scoped_name(interface, definition, base_name): |
120 if 'ImplementedInPrivateScript' in definition.extended_attributes: | 120 if 'ImplementedInPrivateScript' in definition.extended_attributes: |
121 return '%s::%s' % (v8_class_name(interface), base_name) | 121 return '%s::PrivateScript::%s' % (v8_class_name(interface), base_name) |
122 # partial interfaces are implemented as separate classes, with their members | 122 # partial interfaces are implemented as separate classes, with their members |
123 # implemented as static member functions | 123 # implemented as static member functions |
124 partial_interface_implemented_as = definition.extended_attributes.get('Parti
alInterfaceImplementedAs') | 124 partial_interface_implemented_as = definition.extended_attributes.get('Parti
alInterfaceImplementedAs') |
125 if partial_interface_implemented_as: | 125 if partial_interface_implemented_as: |
126 return '%s::%s' % (partial_interface_implemented_as, base_name) | 126 return '%s::%s' % (partial_interface_implemented_as, base_name) |
127 if (definition.is_static or | 127 if (definition.is_static or |
128 definition.name in ('Constructor', 'NamedConstructor')): | 128 definition.name in ('Constructor', 'NamedConstructor')): |
129 return '%s::%s' % (cpp_name(interface), base_name) | 129 return '%s::%s' % (cpp_name(interface), base_name) |
130 return 'impl->%s' % base_name | 130 return 'impl->%s' % base_name |
131 | 131 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 273 |
274 The returned function checks if a method/attribute is enabled. | 274 The returned function checks if a method/attribute is enabled. |
275 Given extended attribute RuntimeEnabled=FeatureName, return: | 275 Given extended attribute RuntimeEnabled=FeatureName, return: |
276 RuntimeEnabledFeatures::{featureName}Enabled | 276 RuntimeEnabledFeatures::{featureName}Enabled |
277 """ | 277 """ |
278 extended_attributes = definition_or_member.extended_attributes | 278 extended_attributes = definition_or_member.extended_attributes |
279 if 'RuntimeEnabled' not in extended_attributes: | 279 if 'RuntimeEnabled' not in extended_attributes: |
280 return None | 280 return None |
281 feature_name = extended_attributes['RuntimeEnabled'] | 281 feature_name = extended_attributes['RuntimeEnabled'] |
282 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) | 282 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) |
OLD | NEW |