| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2012, 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 """This module provides shared functionality for the systems to generate | 6 """This module provides shared functionality for the systems to generate |
| 7 native binding from the IDL database.""" | 7 native binding from the IDL database.""" |
| 8 | 8 |
| 9 import emitter | 9 import emitter |
| 10 import os | 10 import os |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 return False | 458 return False |
| 459 | 459 |
| 460 def AddAttribute(self, getter, setter): | 460 def AddAttribute(self, getter, setter): |
| 461 if 'CheckSecurityForNode' in (getter or setter).ext_attrs: | 461 if 'CheckSecurityForNode' in (getter or setter).ext_attrs: |
| 462 # FIXME: exclude from interface as well. | 462 # FIXME: exclude from interface as well. |
| 463 return | 463 return |
| 464 | 464 |
| 465 # FIXME: these should go away. | 465 # FIXME: these should go away. |
| 466 classes_with_unsupported_custom_getters = [ | 466 classes_with_unsupported_custom_getters = [ |
| 467 'Clipboard', 'Console', 'Coordinates', 'DeviceMotionEvent', | 467 'Clipboard', 'Console', 'Coordinates', 'DeviceMotionEvent', |
| 468 'DeviceOrientationEvent', 'FileReader', 'JavaScriptCallFrame', | 468 'DeviceOrientationEvent', 'JavaScriptCallFrame', |
| 469 'HTMLInputElement', 'HTMLOptionsCollection', 'HTMLOutputElement', | 469 'HTMLInputElement', 'HTMLOptionsCollection', 'HTMLOutputElement', |
| 470 'ScriptProfileNode', 'WebKitAnimation'] | 470 'ScriptProfileNode', 'WebKitAnimation'] |
| 471 if (self._interface.id in classes_with_unsupported_custom_getters and | 471 if (self._interface.id in classes_with_unsupported_custom_getters and |
| 472 getter and set(['Custom', 'CustomGetter']) & set(getter.ext_attrs)): | 472 getter and set(['Custom', 'CustomGetter']) & set(getter.ext_attrs)): |
| 473 return | 473 return |
| 474 | 474 |
| 475 if getter: | 475 if getter: |
| 476 self._AddGetter(getter) | 476 self._AddGetter(getter) |
| 477 if setter: | 477 if setter: |
| 478 self._AddSetter(setter) | 478 self._AddSetter(setter) |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 def _InstanceOfNode(database, interface): | 846 def _InstanceOfNode(database, interface): |
| 847 if interface.id == 'Node': | 847 if interface.id == 'Node': |
| 848 return True | 848 return True |
| 849 for parent in interface.parents: | 849 for parent in interface.parents: |
| 850 if not database.HasInterface(parent.type.id): | 850 if not database.HasInterface(parent.type.id): |
| 851 continue | 851 continue |
| 852 parent_interface = database.GetInterface(parent.type.id) | 852 parent_interface = database.GetInterface(parent.type.id) |
| 853 if _InstanceOfNode(database, parent_interface): | 853 if _InstanceOfNode(database, parent_interface): |
| 854 return True | 854 return True |
| 855 return False | 855 return False |
| OLD | NEW |