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 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 727 to_dart_conversion = return_type_info.to_dart_conversion(function_call, se lf._interface.id, ext_attrs) | 727 to_dart_conversion = return_type_info.to_dart_conversion(function_call, se lf._interface.id, ext_attrs) |
| 728 invocation_emitter.Emit( | 728 invocation_emitter.Emit( |
| 729 ' Dart_Handle returnValue = $TO_DART_CONVERSION;\n' | 729 ' Dart_Handle returnValue = $TO_DART_CONVERSION;\n' |
| 730 ' if (returnValue)\n' | 730 ' if (returnValue)\n' |
| 731 ' Dart_SetReturnValue(args, returnValue);\n', | 731 ' Dart_SetReturnValue(args, returnValue);\n', |
| 732 TO_DART_CONVERSION=to_dart_conversion) | 732 TO_DART_CONVERSION=to_dart_conversion) |
| 733 | 733 |
| 734 def _GenerateNativeBinding(self, idl_name, argument_count, dart_declaration, | 734 def _GenerateNativeBinding(self, idl_name, argument_count, dart_declaration, |
| 735 native_suffix, is_custom): | 735 native_suffix, is_custom): |
| 736 annotations = FormatAnnotationsAndComments( | 736 annotations = FormatAnnotationsAndComments( |
| 737 GetAnnotationsAndComments(self._interface.id, idl_name), ' ') | 737 GetAnnotationsAndComments(self._interface.id, idl_name, |
| 738 self._renamer.GetLibraryName( | |
| 739 self._interface)), | |
| 740 ' ') | |
|
blois
2013/01/28 23:29:04
Odd formatting.
| |
| 738 | 741 |
| 739 native_binding = '%s_%s_%s' % (self._interface.id, idl_name, native_suffix) | 742 native_binding = '%s_%s_%s' % (self._interface.id, idl_name, native_suffix) |
| 740 self._members_emitter.Emit( | 743 self._members_emitter.Emit( |
| 741 '\n' | 744 '\n' |
| 742 ' $ANNOTATIONS$DART_DECLARATION native "$NATIVE_BINDING";\n', | 745 ' $ANNOTATIONS$DART_DECLARATION native "$NATIVE_BINDING";\n', |
| 743 DOMINTERFACE=self._interface.id, | 746 DOMINTERFACE=self._interface.id, |
| 744 ANNOTATIONS=annotations, | 747 ANNOTATIONS=annotations, |
| 745 DART_DECLARATION=dart_declaration, | 748 DART_DECLARATION=dart_declaration, |
| 746 NATIVE_BINDING=native_binding) | 749 NATIVE_BINDING=native_binding) |
| 747 | 750 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 852 LIBRARY_NAME=library_name) | 855 LIBRARY_NAME=library_name) |
| 853 | 856 |
| 854 headers = self._library_headers[library_name] | 857 headers = self._library_headers[library_name] |
| 855 for header_file in headers: | 858 for header_file in headers: |
| 856 path = os.path.relpath(header_file, output_dir) | 859 path = os.path.relpath(header_file, output_dir) |
| 857 includes_emitter.Emit('#include "$PATH"\n', PATH=path) | 860 includes_emitter.Emit('#include "$PATH"\n', PATH=path) |
| 858 body_emitter.Emit( | 861 body_emitter.Emit( |
| 859 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu mentCount))\n' | 862 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu mentCount))\n' |
| 860 ' return func;\n', | 863 ' return func;\n', |
| 861 CLASS_NAME=os.path.splitext(os.path.basename(path))[0]) | 864 CLASS_NAME=os.path.splitext(os.path.basename(path))[0]) |
| OLD | NEW |