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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 452 |
453 _logger.info('importing interface %s (source=%s)' | 453 _logger.info('importing interface %s (source=%s)' |
454 % (interface.id, import_options.source)) | 454 % (interface.id, import_options.source)) |
455 interface.attributes = filter(enabled, interface.attributes) | 455 interface.attributes = filter(enabled, interface.attributes) |
456 interface.operations = filter(enabled, interface.operations) | 456 interface.operations = filter(enabled, interface.operations) |
457 self._imported_interfaces.append((interface, import_options)) | 457 self._imported_interfaces.append((interface, import_options)) |
458 | 458 |
459 for implStmt in idl_file.implementsStatements: | 459 for implStmt in idl_file.implementsStatements: |
460 self._impl_stmts.append((implStmt, import_options)) | 460 self._impl_stmts.append((implStmt, import_options)) |
461 | 461 |
| 462 for enum in idl_file.enums: |
| 463 self._database.AddEnum(enum) |
| 464 |
462 | 465 |
463 def _is_node_enabled(self, node, idl_defines): | 466 def _is_node_enabled(self, node, idl_defines): |
464 if not 'Conditional' in node.ext_attrs: | 467 if not 'Conditional' in node.ext_attrs: |
465 return True | 468 return True |
466 | 469 |
467 def enabled(condition): | 470 def enabled(condition): |
468 return 'ENABLE_%s' % condition in idl_defines | 471 return 'ENABLE_%s' % condition in idl_defines |
469 | 472 |
470 conditional = node.ext_attrs['Conditional'] | 473 conditional = node.ext_attrs['Conditional'] |
471 if conditional.find('&') != -1: | 474 if conditional.find('&') != -1: |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 # TODO(antonm): Ideally we'd like to have pristine copy of WebKit IDLs and
fetch | 562 # TODO(antonm): Ideally we'd like to have pristine copy of WebKit IDLs and
fetch |
560 # this information directly from it. Unfortunately right now database is
massaged | 563 # this information directly from it. Unfortunately right now database is
massaged |
561 # a lot so it's difficult to maintain necessary information on DOMWindow i
tself. | 564 # a lot so it's difficult to maintain necessary information on DOMWindow i
tself. |
562 interface = self._database.GetInterface(type) | 565 interface = self._database.GetInterface(type) |
563 if 'V8EnabledPerContext' in attr.ext_attrs: | 566 if 'V8EnabledPerContext' in attr.ext_attrs: |
564 interface.ext_attrs['synthesizedV8EnabledPerContext'] = \ | 567 interface.ext_attrs['synthesizedV8EnabledPerContext'] = \ |
565 attr.ext_attrs['V8EnabledPerContext'] | 568 attr.ext_attrs['V8EnabledPerContext'] |
566 if 'V8EnabledAtRuntime' in attr.ext_attrs: | 569 if 'V8EnabledAtRuntime' in attr.ext_attrs: |
567 interface.ext_attrs['synthesizedV8EnabledAtRuntime'] = \ | 570 interface.ext_attrs['synthesizedV8EnabledAtRuntime'] = \ |
568 attr.ext_attrs['V8EnabledAtRuntime'] or attr.id | 571 attr.ext_attrs['V8EnabledAtRuntime'] or attr.id |
OLD | NEW |