| 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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 cpp_arguments = ['document'] | 782 cpp_arguments = ['document'] |
| 783 | 783 |
| 784 if 'ImplementedBy' in ext_attrs: | 784 if 'ImplementedBy' in ext_attrs: |
| 785 assert needs_receiver | 785 assert needs_receiver |
| 786 self._cpp_impl_includes.add('"%s.h"' % ext_attrs['ImplementedBy']) | 786 self._cpp_impl_includes.add('"%s.h"' % ext_attrs['ImplementedBy']) |
| 787 cpp_arguments.append('receiver') | 787 cpp_arguments.append('receiver') |
| 788 | 788 |
| 789 if 'Reflect' in ext_attrs: | 789 if 'Reflect' in ext_attrs: |
| 790 cpp_arguments = [self._GenerateWebCoreReflectionAttributeName(node)] | 790 cpp_arguments = [self._GenerateWebCoreReflectionAttributeName(node)] |
| 791 | 791 |
| 792 if return_type_is_nullable: | |
| 793 cpp_arguments = ['isNull'] | |
| 794 | |
| 795 if ext_attrs.get('CustomElementCallbacks') == 'Enable': | 792 if ext_attrs.get('CustomElementCallbacks') == 'Enable': |
| 796 self._cpp_impl_includes.add('"core/dom/CustomElementCallbackDispatcher.h"'
) | 793 self._cpp_impl_includes.add('"core/dom/CustomElementCallbackDispatcher.h"'
) |
| 797 needs_custom_element_callbacks = True | 794 needs_custom_element_callbacks = True |
| 798 | 795 |
| 796 if return_type_is_nullable: |
| 797 cpp_arguments = ['isNull'] |
| 798 |
| 799 v8EnabledPerContext = ext_attrs.get('synthesizedV8EnabledPerContext', ext_at
trs.get('V8EnabledPerContext')) | 799 v8EnabledPerContext = ext_attrs.get('synthesizedV8EnabledPerContext', ext_at
trs.get('V8EnabledPerContext')) |
| 800 v8EnabledAtRuntime = ext_attrs.get('synthesizedV8EnabledAtRuntime', ext_attr
s.get('V8EnabledAtRuntime')) | 800 v8EnabledAtRuntime = ext_attrs.get('synthesizedV8EnabledAtRuntime', ext_attr
s.get('V8EnabledAtRuntime')) |
| 801 assert(not (v8EnabledPerContext and v8EnabledAtRuntime)) | 801 assert(not (v8EnabledPerContext and v8EnabledAtRuntime)) |
| 802 | 802 |
| 803 if v8EnabledPerContext: | 803 if v8EnabledPerContext: |
| 804 raises_exceptions = True | 804 raises_exceptions = True |
| 805 self._cpp_impl_includes.add('"ContextFeatures.h"') | 805 self._cpp_impl_includes.add('"ContextFeatures.h"') |
| 806 self._cpp_impl_includes.add('"DOMWindow.h"') | 806 self._cpp_impl_includes.add('"DOMWindow.h"') |
| 807 runtime_check = emitter.Format( | 807 runtime_check = emitter.Format( |
| 808 ' if (!ContextFeatures::$(FEATURE)Enabled(DartUtilities::domWin
dowForCurrentIsolate()->document())) {\n' | 808 ' if (!ContextFeatures::$(FEATURE)Enabled(DartUtilities::domWin
dowForCurrentIsolate()->document())) {\n' |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1179 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu
mentCount))\n' | 1179 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu
mentCount))\n' |
| 1180 ' return func;\n', | 1180 ' return func;\n', |
| 1181 CLASS_NAME=os.path.splitext(os.path.basename(path))[0]) | 1181 CLASS_NAME=os.path.splitext(os.path.basename(path))[0]) |
| 1182 | 1182 |
| 1183 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): | 1183 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): |
| 1184 return ( | 1184 return ( |
| 1185 interface.id.endswith('Event') and | 1185 interface.id.endswith('Event') and |
| 1186 operation.id.startswith('init') and | 1186 operation.id.startswith('init') and |
| 1187 argument.ext_attrs.get('Default') == 'Undefined' and | 1187 argument.ext_attrs.get('Default') == 'Undefined' and |
| 1188 argument.type.id == 'DOMString') | 1188 argument.type.id == 'DOMString') |
| OLD | NEW |