| 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 |
| 11 from generator import * | 11 from generator import * |
| 12 from htmldartgenerator import * | 12 from htmldartgenerator import * |
| 13 from idlnode import IDLArgument, IDLAttribute | 13 from idlnode import IDLArgument, IDLAttribute |
| 14 from systemhtml import js_support_checks, GetCallbackInfo, HTML_LIBRARY_NAMES | 14 from systemhtml import js_support_checks, GetCallbackInfo, HTML_LIBRARY_NAMES |
| 15 | 15 |
| 16 # This is an ugly hack to get things working on the M35 roll. Once we | 16 # This is an ugly hack to get things working on the M35 roll. Once we |
| 17 # generate dart:blink from the new scripts, this shouldn't be needed. | 17 # generate dart:blink from the new scripts, this shouldn't be needed. |
| 18 _cpp_resolver_string_map = { | 18 _cpp_resolver_string_map = { |
| 19 # These custom constructors all resolve to a common entry, so choosing any | 19 # These custom constructors all resolve to a common entry, so choosing any |
| 20 # of the generated strings works. | 20 # of the generated strings works. |
| 21 'Blob_constructorCallback_RESOLVER_STRING_3_Array_DOMString_DOMString': | 21 'Blob_constructorCallback_RESOLVER_STRING_3_Array_DOMString_DOMString': |
| 22 'Blob_constructorCallback_RESOLVER_STRING_0_', | 22 'Blob_constructorCallback_RESOLVER_STRING_0_', |
| 23 'ConsoleBase_assertCondition_Callback_RESOLVER_STRING_2_boolean_object': |
| 24 'ConsoleBase_assert_Callback_RESOLVER_STRING_2_boolean_object', |
| 25 'FormData_constructorCallback': |
| 26 'FormData_constructorCallback_RESOLVER_STRING_1_HTMLFormElement', |
| 23 'XMLHttpRequest_constructorCallback_RESOLVER_STRING_0_': | 27 'XMLHttpRequest_constructorCallback_RESOLVER_STRING_0_': |
| 24 'XMLHttpRequest_constructorCallback_RESOLVER_STRING_1_XMLHttpRequestOpti
ons', | 28 'XMLHttpRequest_constructorCallback_RESOLVER_STRING_1_XMLHttpRequestOpti
ons', |
| 25 } | 29 } |
| 26 | 30 |
| 27 # TODO(vsm): This logic needs to pulled from the source IDL. These tables are | 31 # TODO(vsm): This logic needs to pulled from the source IDL. These tables are |
| 28 # an ugly workaround. | 32 # an ugly workaround. |
| 29 _cpp_callback_map = { | 33 _cpp_callback_map = { |
| 30 ('DataTransferItem', 'webkitGetAsEntry'): 'DataTransferItemFileSystem', | 34 ('DataTransferItem', 'webkitGetAsEntry'): 'DataTransferItemFileSystem', |
| 31 ('Document', 'fonts'): 'DocumentFontFaceSet', | 35 ('Document', 'fonts'): 'DocumentFontFaceSet', |
| 32 ('Document', 'webkitIsFullScreen'): 'DocumentFullscreen', | 36 ('Document', 'webkitIsFullScreen'): 'DocumentFullscreen', |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 _cpp_overloaded_callback_map = { | 146 _cpp_overloaded_callback_map = { |
| 143 ('DOMURL', 'createObjectUrlFromSourceCallback'): 'URLMediaSource', | 147 ('DOMURL', 'createObjectUrlFromSourceCallback'): 'URLMediaSource', |
| 144 ('DOMURL', 'createObjectUrlFromStreamCallback'): 'URLMediaStream', | 148 ('DOMURL', 'createObjectUrlFromStreamCallback'): 'URLMediaStream', |
| 145 ('DOMURL', '_createObjectUrlFromWebKitSourceCallback'): 'URLMediaSource', | 149 ('DOMURL', '_createObjectUrlFromWebKitSourceCallback'): 'URLMediaSource', |
| 146 ('DOMURL', '_createObjectURL_2Callback'): 'URLMediaSource', | 150 ('DOMURL', '_createObjectURL_2Callback'): 'URLMediaSource', |
| 147 ('DOMURL', '_createObjectURL_3Callback'): 'URLMediaStream', | 151 ('DOMURL', '_createObjectURL_3Callback'): 'URLMediaStream', |
| 148 } | 152 } |
| 149 | 153 |
| 150 _blink_1916_rename_map = { | 154 _blink_1916_rename_map = { |
| 151 'NavigatorID': 'Navigator', | 155 'NavigatorID': 'Navigator', |
| 156 'CanvasRenderingContext' : 'CanvasRenderingContext2D', |
| 152 'Clipboard': 'DataTransfer', | 157 'Clipboard': 'DataTransfer', |
| 153 'Player': 'AnimationPlayer', | 158 'Player': 'AnimationPlayer', |
| 154 } | 159 } |
| 155 | 160 |
| 156 _cpp_partial_map = {} | 161 _cpp_partial_map = {} |
| 157 | 162 |
| 158 _cpp_no_auto_scope_list = set([ | 163 _cpp_no_auto_scope_list = set([ |
| 159 ('Document', 'body', 'Getter'), | 164 ('Document', 'body', 'Getter'), |
| 160 ('Document', 'getElementById', 'Callback'), | 165 ('Document', 'getElementById', 'Callback'), |
| 161 ('Document', 'getElementsByName', 'Callback'), | 166 ('Document', 'getElementsByName', 'Callback'), |
| (...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1973 e.Emit("};\n"); | 1978 e.Emit("};\n"); |
| 1974 e.Emit('\n'); | 1979 e.Emit('\n'); |
| 1975 e.Emit('} // namespace WebCore\n'); | 1980 e.Emit('} // namespace WebCore\n'); |
| 1976 | 1981 |
| 1977 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): | 1982 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): |
| 1978 return ( | 1983 return ( |
| 1979 interface.id.endswith('Event') and | 1984 interface.id.endswith('Event') and |
| 1980 operation.id.startswith('init') and | 1985 operation.id.startswith('init') and |
| 1981 argument.ext_attrs.get('Default') == 'Undefined' and | 1986 argument.ext_attrs.get('Default') == 'Undefined' and |
| 1982 argument.type.id == 'DOMString') | 1987 argument.type.id == 'DOMString') |
| OLD | NEW |