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

Side by Side Diff: runtime/vm/native_entry.cc

Issue 10014002: Rename Api::NewLocalHandle -> Api::NewHandle. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | « runtime/vm/debugger_api_impl.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/native_entry.h" 5 #include "vm/native_entry.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 10
11 namespace dart { 11 namespace dart {
12 12
13 DEFINE_FLAG(bool, trace_natives, false, "Trace invocation of natives"); 13 DEFINE_FLAG(bool, trace_natives, false, "Trace invocation of natives");
14 14
15 NativeFunction NativeEntry::ResolveNative(const Class& cls, 15 NativeFunction NativeEntry::ResolveNative(const Class& cls,
16 const String& function_name, 16 const String& function_name,
17 int number_of_arguments) { 17 int number_of_arguments) {
18 // Now resolve the native function to the corresponding native entrypoint. 18 // Now resolve the native function to the corresponding native entrypoint.
19 const Library& library = Library::Handle(cls.library()); 19 const Library& library = Library::Handle(cls.library());
20 if (library.native_entry_resolver() == 0) { 20 if (library.native_entry_resolver() == 0) {
21 // Native methods are not allowed in the library to which this 21 // Native methods are not allowed in the library to which this
22 // class belongs in. 22 // class belongs in.
23 return NULL; 23 return NULL;
24 } 24 }
25 Dart_EnterScope(); // Enter a new Dart API scope as we invoke API entries. 25 Dart_EnterScope(); // Enter a new Dart API scope as we invoke API entries.
26 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); 26 Dart_NativeEntryResolver resolver = library.native_entry_resolver();
27 Dart_NativeFunction native_function = 27 Dart_NativeFunction native_function =
28 resolver(Api::NewLocalHandle(Isolate::Current(), function_name), 28 resolver(Api::NewHandle(Isolate::Current(), function_name.raw()),
29 number_of_arguments); 29 number_of_arguments);
30 Dart_ExitScope(); // Exit the Dart API scope. 30 Dart_ExitScope(); // Exit the Dart API scope.
31 return reinterpret_cast<NativeFunction>(native_function); 31 return reinterpret_cast<NativeFunction>(native_function);
32 } 32 }
33 33
34 } // namespace dart 34 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/debugger_api_impl.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698