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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 # [MeasureAs] | 125 # [MeasureAs] |
126 def _measure_as(definition_or_member): | 126 def _measure_as(definition_or_member): |
127 extended_attributes = definition_or_member.extended_attributes | 127 extended_attributes = definition_or_member.extended_attributes |
128 if 'MeasureAs' not in extended_attributes: | 128 if 'MeasureAs' not in extended_attributes: |
129 return None | 129 return None |
130 # TODO(terry): Remove Me? | 130 # TODO(terry): Remove Me? |
131 # includes.add('core/frame/UseCounter.h') | 131 # includes.add('core/frame/UseCounter.h') |
132 return extended_attributes['MeasureAs'] | 132 return extended_attributes['MeasureAs'] |
133 | 133 |
134 | 134 |
135 def _generate_native_entry(interface_name, thing, name, kind, | 135 def _generate_native_entry(interface_name, thing, name, kind, args): |
136 optional_index, args, types): | |
137 index = thing.get('overload_index') or optional_index | |
138 is_static = bool(thing.get('is_static')) | 136 is_static = bool(thing.get('is_static')) |
139 tag = "" | 137 tag = "" |
140 if kind == 'Getter': | 138 if kind == 'Getter': |
141 tag = "%s_Getter" % name | 139 tag = "%s_Getter" % name |
142 blink_entry = tag | 140 blink_entry = tag |
143 elif kind == 'Setter': | 141 elif kind == 'Setter': |
144 tag = "%s_Setter" % name | 142 tag = "%s_Setter" % name |
145 blink_entry = tag | 143 blink_entry = tag |
146 elif kind == 'Constructor': | 144 elif kind == 'Constructor': |
147 tag = "constructorCallback" | 145 tag = "constructorCallback" |
148 blink_entry = tag | 146 blink_entry = tag |
149 if index is not None: | |
150 blink_entry = "_create_%s%s" % (index, blink_entry) | |
151 elif kind == 'Method': | 147 elif kind == 'Method': |
152 tag = "%s_Callback" % name | 148 tag = "%s_Callback" % name |
153 if index is None: | 149 blink_entry = tag |
154 blink_entry = tag | |
155 else: | |
156 blink_entry = "_%s_%d_Callback" % (name, index) | |
157 components = [interface_name, tag] | 150 components = [interface_name, tag] |
158 if types is not None: | |
159 components.extend(types) | |
160 native_entry = "_".join(components) | 151 native_entry = "_".join(components) |
161 if not is_static and kind != 'Constructor': | 152 if not is_static and kind != 'Constructor': |
162 args.insert(0, "mthis") | 153 args.insert(0, "mthis") |
163 return {'blink_entry': "$" + blink_entry, | 154 return {'blink_entry': "$" + blink_entry, |
164 'argument_names': args, | 155 'argument_names': args, |
165 'resolver_string': native_entry} | 156 'resolver_string': native_entry} |
166 | 157 |
167 ################################################################################ | 158 ################################################################################ |
168 # This is the monkey patched methods most delegate to v8_utilities but some are | 159 # This is the monkey patched methods most delegate to v8_utilities but some are |
169 # overridden in dart_utilities. | 160 # overridden in dart_utilities. |
(...skipping 18 matching lines...) Expand all Loading... |
188 DartUtilities.generate_native_entry = _generate_native_entry | 179 DartUtilities.generate_native_entry = _generate_native_entry |
189 DartUtilities.has_extended_attribute = v8_utilities.has_extended_attribute | 180 DartUtilities.has_extended_attribute = v8_utilities.has_extended_attribute |
190 DartUtilities.has_extended_attribute_value = v8_utilities.has_extended_attribute
_value | 181 DartUtilities.has_extended_attribute_value = v8_utilities.has_extended_attribute
_value |
191 DartUtilities.measure_as = _measure_as | 182 DartUtilities.measure_as = _measure_as |
192 DartUtilities.per_context_enabled_function_name = v8_utilities.per_context_enabl
ed_function_name | 183 DartUtilities.per_context_enabled_function_name = v8_utilities.per_context_enabl
ed_function_name |
193 DartUtilities.runtime_enabled_function_name = v8_utilities.runtime_enabled_funct
ion_name | 184 DartUtilities.runtime_enabled_function_name = v8_utilities.runtime_enabled_funct
ion_name |
194 DartUtilities.scoped_name = _scoped_name | 185 DartUtilities.scoped_name = _scoped_name |
195 DartUtilities.strip_suffix = v8_utilities.strip_suffix | 186 DartUtilities.strip_suffix = v8_utilities.strip_suffix |
196 DartUtilities.uncapitalize = v8_utilities.uncapitalize | 187 DartUtilities.uncapitalize = v8_utilities.uncapitalize |
197 DartUtilities.v8_class_name = v8_utilities.v8_class_name | 188 DartUtilities.v8_class_name = v8_utilities.v8_class_name |
OLD | NEW |