Chromium Code Reviews| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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::domWin dowForCurrentIsolate()->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 if 'synthesizedV8EnabledAtRuntime' in self._interface.ext_attrs: | |
|
podivilov
2012/06/26 10:51:13
Shouldn't that be elif?
Anton Muhin
2012/06/26 12:16:35
Added assert instead
On 2012/06/26 10:51:13, podi
| |
| 319 raises_exceptions = True | |
| 320 self._cpp_impl_includes.add('"RuntimeEnabledFeatures.h"') | |
| 321 runtime_check = emitter.Format( | |
| 322 ' if (!RuntimeEnabledFeatures::$(FEATURE)Enabled()) {\n' | |
| 323 ' exception = Dart_NewString("Feature $FEATURE is not enabl ed");\n' | |
| 324 ' goto fail;\n' | |
| 325 ' }', | |
| 326 FEATURE=self._interface.ext_attrs['synthesizedV8EnabledAtRuntime']) | |
| 327 | |
| 318 self._GenerateNativeCallback(callback_name='constructorCallback', | 328 self._GenerateNativeCallback(callback_name='constructorCallback', |
| 319 parameter_definitions=parameter_definitions_emitter.Fragments(), | 329 parameter_definitions=parameter_definitions_emitter.Fragments(), |
| 320 needs_receiver=False, invocation=invocation, | 330 needs_receiver=False, invocation=invocation, |
| 321 raises_exceptions=raises_exceptions, | 331 raises_exceptions=raises_exceptions, |
| 322 runtime_check=runtime_check) | 332 runtime_check=runtime_check) |
| 323 | 333 |
| 324 def _EmitHtmlElementFactoryConstructors(self, infos, html_interface_name): | 334 def _EmitHtmlElementFactoryConstructors(self, infos, html_interface_name): |
| 325 EmitHtmlElementFactoryConstructors( | 335 EmitHtmlElementFactoryConstructors( |
| 326 self._system._EmitterForFactoryProviderBody( | 336 self._system._EmitterForFactoryProviderBody( |
| 327 infos[0].factory_provider_name), | 337 infos[0].factory_provider_name), |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1072 continue | 1082 continue |
| 1073 parent_interface = database.GetInterface(parent.type.id) | 1083 parent_interface = database.GetInterface(parent.type.id) |
| 1074 if callback(parent_interface): | 1084 if callback(parent_interface): |
| 1075 return parent_interface | 1085 return parent_interface |
| 1076 parent_interface = _FindParent(parent_interface, database, callback) | 1086 parent_interface = _FindParent(parent_interface, database, callback) |
| 1077 if parent_interface: | 1087 if parent_interface: |
| 1078 return parent_interface | 1088 return parent_interface |
| 1079 | 1089 |
| 1080 def _IsArgumentOptionalInWebCore(argument): | 1090 def _IsArgumentOptionalInWebCore(argument): |
| 1081 return IsOptional(argument) and not 'Callback' in argument.ext_attrs | 1091 return IsOptional(argument) and not 'Callback' in argument.ext_attrs |
| OLD | NEW |