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

Side by Side Diff: lib/html/scripts/systemnative.py

Issue 11274018: DartCallback is now a DartIsolateDestructionObserver. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | « no previous file | 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 continue 59 continue
60 60
61 cpp_impl_includes |= set(conversion_includes) 61 cpp_impl_includes |= set(conversion_includes)
62 arguments_declaration = 'Dart_Handle arguments[] = { %s }' % ', '.join(arg uments) 62 arguments_declaration = 'Dart_Handle arguments[] = { %s }' % ', '.join(arg uments)
63 if not len(arguments): 63 if not len(arguments):
64 arguments_declaration = 'Dart_Handle* arguments = 0' 64 arguments_declaration = 'Dart_Handle* arguments = 0'
65 cpp_impl_handlers_emitter.Emit( 65 cpp_impl_handlers_emitter.Emit(
66 '\n' 66 '\n'
67 'bool $CLASS_NAME::handleEvent($PARAMETERS)\n' 67 'bool $CLASS_NAME::handleEvent($PARAMETERS)\n'
68 '{\n' 68 '{\n'
69 ' if (!m_callback.isolate()->isAlive())\n' 69 ' if (!m_callback.isolate())\n'
70 ' return false;\n' 70 ' return false;\n'
71 ' DartIsolate::Scope scope(m_callback.isolate());\n' 71 ' DartIsolate::Scope scope(m_callback.isolate());\n'
72 ' DartApiScope apiScope;\n' 72 ' DartApiScope apiScope;\n'
73 ' $ARGUMENTS_DECLARATION;\n' 73 ' $ARGUMENTS_DECLARATION;\n'
74 ' return m_callback.handleEvent($ARGUMENT_COUNT, arguments);\n' 74 ' return m_callback.handleEvent($ARGUMENT_COUNT, arguments);\n'
75 '}\n', 75 '}\n',
76 CLASS_NAME=class_name, 76 CLASS_NAME=class_name,
77 PARAMETERS=', '.join(parameters), 77 PARAMETERS=', '.join(parameters),
78 ARGUMENTS_DECLARATION=arguments_declaration, 78 ARGUMENTS_DECLARATION=arguments_declaration,
79 ARGUMENT_COUNT=len(arguments)) 79 ARGUMENT_COUNT=len(arguments))
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 def EmitResolver(self, template, output_dir): 856 def EmitResolver(self, template, output_dir):
857 file_path = os.path.join(output_dir, 'DartResolver.cpp') 857 file_path = os.path.join(output_dir, 'DartResolver.cpp')
858 includes_emitter, body_emitter = self._emitters.FileEmitter(file_path).Emit( template) 858 includes_emitter, body_emitter = self._emitters.FileEmitter(file_path).Emit( template)
859 for header_file in self._headers_list: 859 for header_file in self._headers_list:
860 path = os.path.relpath(header_file, output_dir) 860 path = os.path.relpath(header_file, output_dir)
861 includes_emitter.Emit('#include "$PATH"\n', PATH=path) 861 includes_emitter.Emit('#include "$PATH"\n', PATH=path)
862 body_emitter.Emit( 862 body_emitter.Emit(
863 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argume ntCount))\n' 863 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argume ntCount))\n'
864 ' return func;\n', 864 ' return func;\n',
865 CLASS_NAME=os.path.splitext(os.path.basename(path))[0]) 865 CLASS_NAME=os.path.splitext(os.path.basename(path))[0])
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698