| 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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 ' NativeType* value)\n' | 443 ' NativeType* value)\n' |
| 444 ' {\n' | 444 ' {\n' |
| 445 ' if (value) {\n' | 445 ' if (value) {\n' |
| 446 ' DartDOMData* domData = static_cast<DartDOMData*>(\n' | 446 ' DartDOMData* domData = static_cast<DartDOMData*>(\n' |
| 447 ' Dart_GetNativeIsolateData(args));\n' | 447 ' Dart_GetNativeIsolateData(args));\n' |
| 448 ' Dart_WeakPersistentHandle result =\n' | 448 ' Dart_WeakPersistentHandle result =\n' |
| 449 ' DartDOMWrapper::lookupWrapper<Dart$(INTERFACE)>(domData
, value);\n' | 449 ' DartDOMWrapper::lookupWrapper<Dart$(INTERFACE)>(domData
, value);\n' |
| 450 ' if (result)\n' | 450 ' if (result)\n' |
| 451 ' Dart_SetWeakHandleReturnValue(args, result);\n' | 451 ' Dart_SetWeakHandleReturnValue(args, result);\n' |
| 452 ' else {\n' | 452 ' else {\n' |
| 453 ' DartApiScope apiScope();\n' | 453 ' DartApiScope apiScope;\n' |
| 454 ' Dart_SetReturnValue(args, createWrapper(domData, value)
);\n' | 454 ' Dart_SetReturnValue(args, createWrapper(domData, value)
);\n' |
| 455 ' }\n' | 455 ' }\n' |
| 456 ' }\n' | 456 ' }\n' |
| 457 ' }\n', | 457 ' }\n', |
| 458 INTERFACE=self._interface.id) | 458 INTERFACE=self._interface.id) |
| 459 | 459 |
| 460 if ('CustomToV8' in ext_attrs or | 460 if ('CustomToV8' in ext_attrs or |
| 461 'PureInterface' in ext_attrs or | 461 'PureInterface' in ext_attrs or |
| 462 'CPPPureInterface' in ext_attrs or | 462 'CPPPureInterface' in ext_attrs or |
| 463 self._interface_type_info.custom_to_dart()): | 463 self._interface_type_info.custom_to_dart()): |
| (...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1302 e.Emit("};\n"); | 1302 e.Emit("};\n"); |
| 1303 e.Emit('\n'); | 1303 e.Emit('\n'); |
| 1304 e.Emit('} // namespace WebCore\n'); | 1304 e.Emit('} // namespace WebCore\n'); |
| 1305 | 1305 |
| 1306 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): | 1306 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): |
| 1307 return ( | 1307 return ( |
| 1308 interface.id.endswith('Event') and | 1308 interface.id.endswith('Event') and |
| 1309 operation.id.startswith('init') and | 1309 operation.id.startswith('init') and |
| 1310 argument.ext_attrs.get('Default') == 'Undefined' and | 1310 argument.ext_attrs.get('Default') == 'Undefined' and |
| 1311 argument.type.id == 'DOMString') | 1311 argument.type.id == 'DOMString') |
| OLD | NEW |