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

Unified Diff: samples/sample_extension/sample_extension.cc

Issue 117723002: Allow the native resolver to setup whether it needs the Dart API scope to (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/stub_code_x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/sample_extension/sample_extension.cc
===================================================================
--- samples/sample_extension/sample_extension.cc (revision 31283)
+++ samples/sample_extension/sample_extension.cc (working copy)
@@ -7,7 +7,9 @@
#include "include/dart_api.h"
#include "include/dart_native_api.h"
-Dart_NativeFunction ResolveName(Dart_Handle name, int argc);
+Dart_NativeFunction ResolveName(Dart_Handle name,
+ int argc,
+ bool* auto_setup_scope);
DART_EXPORT Dart_Handle sample_extension_Init(Dart_Handle parent_library) {
if (Dart_IsError(parent_library)) { return parent_library; }
@@ -119,9 +121,13 @@
{"RandomArray_ServicePort", randomArrayServicePort},
{NULL, NULL}};
-Dart_NativeFunction ResolveName(Dart_Handle name, int argc) {
+Dart_NativeFunction ResolveName(Dart_Handle name,
+ int argc,
+ bool* auto_setup_scope) {
if (!Dart_IsString(name)) return NULL;
Dart_NativeFunction result = NULL;
+ if (auto_setup_scope == NULL) return NULL;
+ *auto_setup_scope = true;
Dart_EnterScope();
const char* cname;
HandleError(Dart_StringToCString(name, &cname));
« no previous file with comments | « runtime/vm/stub_code_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698