Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: tools/dom/scripts/systemnative.py

Issue 22605010: Use DartExceptionState (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 901
902 body_emitter.Emit('\n') 902 body_emitter.Emit('\n')
903 903
904 if 'NeedsUserGestureCheck' in ext_attrs: 904 if 'NeedsUserGestureCheck' in ext_attrs:
905 cpp_arguments.append('DartUtilities::processingUserGesture') 905 cpp_arguments.append('DartUtilities::processingUserGesture')
906 906
907 invocation_emitter = body_emitter 907 invocation_emitter = body_emitter
908 if raises_dom_exception: 908 if raises_dom_exception:
909 cpp_arguments.append('es') 909 cpp_arguments.append('es')
910 invocation_emitter = body_emitter.Emit( 910 invocation_emitter = body_emitter.Emit(
911 # TODO(vsm): The move from ExceptionCode to ExceptionState adds 911 ' DartExceptionState es;\n'
912 # a V8 dependency. Constructing with a NULL V8 isolate....
913 ' ExceptionState es(0);\n'
914 '$!INVOCATION' 912 '$!INVOCATION'
915 ' if (es.hadException()) {\n' 913 ' if (es.hadException()) {\n'
916 ' exception = DartDOMWrapper::exceptionCodeToDartException(es );\n' 914 ' exception = DartDOMWrapper::exceptionCodeToDartException(es );\n'
917 ' goto fail;\n' 915 ' goto fail;\n'
918 ' }\n') 916 ' }\n')
919 917
920 918
921 if needs_receiver: 919 if needs_receiver:
922 interface_name = self._interface_type_info.native_type() 920 interface_name = self._interface_type_info.native_type()
923 # Hack to determine if this came from the _cpp_callback_map. 921 # Hack to determine if this came from the _cpp_callback_map.
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu mentCount))\n' 1095 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu mentCount))\n'
1098 ' return func;\n', 1096 ' return func;\n',
1099 CLASS_NAME=os.path.splitext(os.path.basename(path))[0]) 1097 CLASS_NAME=os.path.splitext(os.path.basename(path))[0])
1100 1098
1101 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): 1099 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument):
1102 return ( 1100 return (
1103 interface.id.endswith('Event') and 1101 interface.id.endswith('Event') and
1104 operation.id.startswith('init') and 1102 operation.id.startswith('init') and
1105 argument.ext_attrs.get('Default') == 'Undefined' and 1103 argument.ext_attrs.get('Default') == 'Undefined' and
1106 argument.type.id == 'DOMString') 1104 argument.type.id == 'DOMString')
OLDNEW
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698