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, |
| 136 optional_index, args, types): |
| 137 index = thing.get('overload_index') or optional_index |
| 138 is_static = bool(thing.get('is_static')) |
| 139 tag = "" |
| 140 if kind == 'Getter': |
| 141 tag = "%s_Getter" % name |
| 142 blink_entry = tag |
| 143 elif kind == 'Setter': |
| 144 tag = "%s_Setter" % name |
| 145 blink_entry = tag |
| 146 elif kind == 'Constructor': |
| 147 tag = "constructorCallback" |
| 148 blink_entry = tag |
| 149 if index is not None: |
| 150 blink_entry = "_create_%s%s" % (index, blink_entry) |
| 151 elif kind == 'Method': |
| 152 tag = "%s_Callback" % name |
| 153 if index is None: |
| 154 blink_entry = tag |
| 155 else: |
| 156 blink_entry = "_%s_%d_Callback" % (name, index) |
| 157 native_entry = "%s_%s" % (interface_name, tag) |
| 158 if types is not None: |
| 159 count = len(types) |
| 160 types = "_".join(types) |
| 161 native_entry = "%s_RESOLVER_STRING_%d_%s" % (native_entry, count, types) |
| 162 if not is_static and kind != 'Constructor': |
| 163 args.insert(0, "mthis") |
| 164 return {'blink_entry': "$" + blink_entry, |
| 165 'argument_names': args, |
| 166 'resolver_string': native_entry} |
| 167 |
135 ################################################################################ | 168 ################################################################################ |
136 # This is the monkey patched methods most delegate to v8_utilities but some are | 169 # This is the monkey patched methods most delegate to v8_utilities but some are |
137 # overridden in dart_utilities. | 170 # overridden in dart_utilities. |
138 ################################################################################ | 171 ################################################################################ |
139 | 172 |
140 | 173 |
141 class dart_utilities_monkey(): | 174 class dart_utilities_monkey(): |
142 def __init__(self): | 175 def __init__(self): |
143 self.base_class_name = 'dart_utilities' | 176 self.base_class_name = 'dart_utilities' |
144 | 177 |
145 DartUtilities = dart_utilities_monkey() | 178 DartUtilities = dart_utilities_monkey() |
146 | 179 |
147 DartUtilities.activity_logging_world_list = _activity_logging_world_list | 180 DartUtilities.activity_logging_world_list = _activity_logging_world_list |
148 DartUtilities.bool_to_cpp = _bool_to_cpp | 181 DartUtilities.bool_to_cpp = _bool_to_cpp |
149 DartUtilities.call_with_arguments = _call_with_arguments | 182 DartUtilities.call_with_arguments = _call_with_arguments |
150 DartUtilities.capitalize = v8_utilities.capitalize | 183 DartUtilities.capitalize = v8_utilities.capitalize |
151 DartUtilities.conditional_string = v8_utilities.conditional_string | 184 DartUtilities.conditional_string = v8_utilities.conditional_string |
152 DartUtilities.cpp_name = v8_utilities.cpp_name | 185 DartUtilities.cpp_name = v8_utilities.cpp_name |
153 DartUtilities.deprecate_as = _deprecate_as | 186 DartUtilities.deprecate_as = _deprecate_as |
154 DartUtilities.extended_attribute_value_contains = v8_utilities.extended_attribut
e_value_contains | 187 DartUtilities.extended_attribute_value_contains = v8_utilities.extended_attribut
e_value_contains |
155 DartUtilities.gc_type = v8_utilities.gc_type | 188 DartUtilities.gc_type = v8_utilities.gc_type |
| 189 DartUtilities.generate_native_entry = _generate_native_entry |
156 DartUtilities.has_extended_attribute = v8_utilities.has_extended_attribute | 190 DartUtilities.has_extended_attribute = v8_utilities.has_extended_attribute |
157 DartUtilities.has_extended_attribute_value = v8_utilities.has_extended_attribute
_value | 191 DartUtilities.has_extended_attribute_value = v8_utilities.has_extended_attribute
_value |
158 DartUtilities.measure_as = _measure_as | 192 DartUtilities.measure_as = _measure_as |
159 DartUtilities.per_context_enabled_function_name = v8_utilities.per_context_enabl
ed_function_name | 193 DartUtilities.per_context_enabled_function_name = v8_utilities.per_context_enabl
ed_function_name |
160 DartUtilities.runtime_enabled_function_name = v8_utilities.runtime_enabled_funct
ion_name | 194 DartUtilities.runtime_enabled_function_name = v8_utilities.runtime_enabled_funct
ion_name |
161 DartUtilities.scoped_name = _scoped_name | 195 DartUtilities.scoped_name = _scoped_name |
162 DartUtilities.strip_suffix = v8_utilities.strip_suffix | 196 DartUtilities.strip_suffix = v8_utilities.strip_suffix |
163 DartUtilities.uncapitalize = v8_utilities.uncapitalize | 197 DartUtilities.uncapitalize = v8_utilities.uncapitalize |
164 DartUtilities.v8_class_name = v8_utilities.v8_class_name | 198 DartUtilities.v8_class_name = v8_utilities.v8_class_name |
OLD | NEW |