OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 import copy | 6 import copy |
7 import database | 7 import database |
8 import idlparser | 8 import idlparser |
9 import logging | 9 import logging |
10 import multiprocessing | 10 import multiprocessing |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 def _rename_types(self, idl_file, import_options): | 216 def _rename_types(self, idl_file, import_options): |
217 """Rename interface and type names with names provided in the | 217 """Rename interface and type names with names provided in the |
218 options. Also clears scopes from scoped names""" | 218 options. Also clears scopes from scoped names""" |
219 | 219 |
220 strip_modules = lambda name: name.split('::')[-1] | 220 strip_modules = lambda name: name.split('::')[-1] |
221 | 221 |
222 def rename_node(idl_node): | 222 def rename_node(idl_node): |
223 idl_node.reset_id(strip_modules(idl_node.id)) | 223 idl_node.reset_id(strip_modules(idl_node.id)) |
224 | 224 |
225 def rename_ext_attrs(ext_attrs_node): | 225 def rename_ext_attrs(ext_attrs_node): |
226 for type_valued_attribute_name in ['Supplemental']: | 226 for type_valued_attribute_name in ['DartSupplemental']: |
227 if type_valued_attribute_name in ext_attrs_node: | 227 if type_valued_attribute_name in ext_attrs_node: |
228 value = ext_attrs_node[type_valued_attribute_name] | 228 value = ext_attrs_node[type_valued_attribute_name] |
229 if isinstance(value, str): | 229 if isinstance(value, str): |
230 ext_attrs_node[type_valued_attribute_name] = strip_modules(value) | 230 ext_attrs_node[type_valued_attribute_name] = strip_modules(value) |
231 | 231 |
232 map(rename_node, idl_file.all(IDLInterface)) | 232 map(rename_node, idl_file.all(IDLInterface)) |
233 map(rename_node, idl_file.all(IDLType)) | 233 map(rename_node, idl_file.all(IDLType)) |
234 map(rename_ext_attrs, idl_file.all(IDLExtAttrs)) | 234 map(rename_ext_attrs, idl_file.all(IDLExtAttrs)) |
235 | 235 |
236 def _annotate(self, interface, import_options): | 236 def _annotate(self, interface, import_options): |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 # TODO(antonm): Ideally we'd like to have pristine copy of WebKit IDLs and
fetch | 755 # TODO(antonm): Ideally we'd like to have pristine copy of WebKit IDLs and
fetch |
756 # this information directly from it. Unfortunately right now database is
massaged | 756 # this information directly from it. Unfortunately right now database is
massaged |
757 # a lot so it's difficult to maintain necessary information on Window itse
lf. | 757 # a lot so it's difficult to maintain necessary information on Window itse
lf. |
758 interface = self._database.GetInterface(type) | 758 interface = self._database.GetInterface(type) |
759 if 'V8EnabledPerContext' in attr.ext_attrs: | 759 if 'V8EnabledPerContext' in attr.ext_attrs: |
760 interface.ext_attrs['synthesizedV8EnabledPerContext'] = \ | 760 interface.ext_attrs['synthesizedV8EnabledPerContext'] = \ |
761 attr.ext_attrs['V8EnabledPerContext'] | 761 attr.ext_attrs['V8EnabledPerContext'] |
762 if 'V8EnabledAtRuntime' in attr.ext_attrs: | 762 if 'V8EnabledAtRuntime' in attr.ext_attrs: |
763 interface.ext_attrs['synthesizedV8EnabledAtRuntime'] = \ | 763 interface.ext_attrs['synthesizedV8EnabledAtRuntime'] = \ |
764 attr.ext_attrs['V8EnabledAtRuntime'] or attr.id | 764 attr.ext_attrs['V8EnabledAtRuntime'] or attr.id |
OLD | NEW |