| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 function_expression = '%s::%s' % (self._interface_type_info.native_type(), c
reate_function) | 302 function_expression = '%s::%s' % (self._interface_type_info.native_type(), c
reate_function) |
| 303 invocation = self._GenerateWebCoreInvocation(function_expression, arguments, | 303 invocation = self._GenerateWebCoreInvocation(function_expression, arguments, |
| 304 self._interface.id, self._interface.ext_attrs, raises_dom_exceptions) | 304 self._interface.id, self._interface.ext_attrs, raises_dom_exceptions) |
| 305 | 305 |
| 306 runtime_check = None | 306 runtime_check = None |
| 307 database = self._system._database | 307 database = self._system._database |
| 308 if 'synthesizedV8EnabledPerContext' in self._interface.ext_attrs: | 308 if 'synthesizedV8EnabledPerContext' in self._interface.ext_attrs: |
| 309 raises_exceptions = True | 309 raises_exceptions = True |
| 310 self._cpp_impl_includes.add('"ContextFeatures.h"') | 310 self._cpp_impl_includes.add('"ContextFeatures.h"') |
| 311 runtime_check = emitter.Format( | 311 runtime_check = emitter.Format( |
| 312 ' if (ContextFeatures::$(FEATURE)Enabled(DartUtilities::domWind
owForCurrentIsolate()->document())) {\n' | 312 ' if (!ContextFeatures::$(FEATURE)Enabled(DartUtilities::domWin
dowForCurrentIsolate()->document())) {\n' |
| 313 ' exception = Dart_NewString("Feature $FEATURE is not enabl
ed");\n' | 313 ' exception = Dart_NewString("Feature $FEATURE is not enabl
ed");\n' |
| 314 ' goto fail;\n' | 314 ' goto fail;\n' |
| 315 ' }', | 315 ' }', |
| 316 FEATURE=self._interface.ext_attrs['synthesizedV8EnabledPerContext']) | 316 FEATURE=self._interface.ext_attrs['synthesizedV8EnabledPerContext']) |
| 317 | 317 |
| 318 self._GenerateNativeCallback(callback_name='constructorCallback', | 318 self._GenerateNativeCallback(callback_name='constructorCallback', |
| 319 parameter_definitions=parameter_definitions_emitter.Fragments(), | 319 parameter_definitions=parameter_definitions_emitter.Fragments(), |
| 320 needs_receiver=False, invocation=invocation, | 320 needs_receiver=False, invocation=invocation, |
| 321 raises_exceptions=raises_exceptions, | 321 raises_exceptions=raises_exceptions, |
| 322 runtime_check=runtime_check) | 322 runtime_check=runtime_check) |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 continue | 1072 continue |
| 1073 parent_interface = database.GetInterface(parent.type.id) | 1073 parent_interface = database.GetInterface(parent.type.id) |
| 1074 if callback(parent_interface): | 1074 if callback(parent_interface): |
| 1075 return parent_interface | 1075 return parent_interface |
| 1076 parent_interface = _FindParent(parent_interface, database, callback) | 1076 parent_interface = _FindParent(parent_interface, database, callback) |
| 1077 if parent_interface: | 1077 if parent_interface: |
| 1078 return parent_interface | 1078 return parent_interface |
| 1079 | 1079 |
| 1080 def _IsArgumentOptionalInWebCore(argument): | 1080 def _IsArgumentOptionalInWebCore(argument): |
| 1081 return IsOptional(argument) and not 'Callback' in argument.ext_attrs | 1081 return IsOptional(argument) and not 'Callback' in argument.ext_attrs |
| OLD | NEW |