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

Unified Diff: runtime/bin/directory.cc

Issue 22303002: Auto create ApiLocalScope before calling native functions, this ensures that (Closed) Base URL: http://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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/crypto.cc ('k') | runtime/bin/eventhandler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory.cc
===================================================================
--- runtime/bin/directory.cc (revision 25822)
+++ runtime/bin/directory.cc (working copy)
@@ -22,18 +22,15 @@
void FUNCTION_NAME(Directory_Current)(Dart_NativeArguments args) {
- Dart_EnterScope();
char* current = Directory::Current();
if (current != NULL) {
Dart_SetReturnValue(args, DartUtils::NewString(current));
free(current);
}
- Dart_ExitScope();
}
void FUNCTION_NAME(Directory_SetCurrent)(Dart_NativeArguments args) {
- Dart_EnterScope();
int argc = Dart_GetNativeArgumentCount(args);
Dart_Handle path;
if (argc == 1) {
@@ -50,14 +47,12 @@
Dart_SetReturnValue(args, err);
}
}
- Dart_ExitScope();
}
void FUNCTION_NAME(Directory_Exists)(Dart_NativeArguments args) {
static const int kExists = 1;
static const int kDoesNotExist = 0;
- Dart_EnterScope();
Dart_Handle path = Dart_GetNativeArgument(args, 0);
Directory::ExistsResult result =
Directory::Exists(DartUtils::GetStringValue(path));
@@ -70,12 +65,10 @@
if (Dart_IsError(err)) Dart_PropagateError(err);
Dart_SetReturnValue(args, err);
}
- Dart_ExitScope();
}
void FUNCTION_NAME(Directory_Create)(Dart_NativeArguments args) {
- Dart_EnterScope();
Dart_Handle path = Dart_GetNativeArgument(args, 0);
if (Directory::Create(DartUtils::GetStringValue(path))) {
Dart_SetReturnValue(args, Dart_True());
@@ -84,12 +77,10 @@
if (Dart_IsError(err)) Dart_PropagateError(err);
Dart_SetReturnValue(args, err);
}
- Dart_ExitScope();
}
void FUNCTION_NAME(Directory_CreateTemp)(Dart_NativeArguments args) {
- Dart_EnterScope();
Dart_Handle path = Dart_GetNativeArgument(args, 0);
char* result = Directory::CreateTemp(DartUtils::GetStringValue(path));
if (result != NULL) {
@@ -100,12 +91,10 @@
if (Dart_IsError(err)) Dart_PropagateError(err);
Dart_SetReturnValue(args, err);
}
- Dart_ExitScope();
}
void FUNCTION_NAME(Directory_Delete)(Dart_NativeArguments args) {
- Dart_EnterScope();
Dart_Handle path = Dart_GetNativeArgument(args, 0);
Dart_Handle recursive = Dart_GetNativeArgument(args, 1);
if (Directory::Delete(DartUtils::GetStringValue(path),
@@ -116,12 +105,10 @@
if (Dart_IsError(err)) Dart_PropagateError(err);
Dart_SetReturnValue(args, err);
}
- Dart_ExitScope();
}
void FUNCTION_NAME(Directory_Rename)(Dart_NativeArguments args) {
- Dart_EnterScope();
Dart_Handle path = Dart_GetNativeArgument(args, 0);
Dart_Handle newPath = Dart_GetNativeArgument(args, 1);
if (Directory::Rename(DartUtils::GetStringValue(path),
@@ -132,12 +119,10 @@
if (Dart_IsError(err)) Dart_PropagateError(err);
Dart_SetReturnValue(args, err);
}
- Dart_ExitScope();
}
void FUNCTION_NAME(Directory_List)(Dart_NativeArguments args) {
- Dart_EnterScope();
Dart_Handle path = Dart_GetNativeArgument(args, 0);
Dart_Handle recursive = Dart_GetNativeArgument(args, 1);
// Create the list to hold the directory listing here, and pass it to the
@@ -156,7 +141,6 @@
DartUtils::GetBooleanValue(follow_links));
Directory::List(&sync_listing);
Dart_SetReturnValue(args, results);
- Dart_ExitScope();
}
@@ -356,7 +340,6 @@
void FUNCTION_NAME(Directory_NewServicePort)(Dart_NativeArguments args) {
- Dart_EnterScope();
Dart_SetReturnValue(args, Dart_Null());
Dart_Port service_port = Directory::GetServicePort();
if (service_port != ILLEGAL_PORT) {
@@ -364,7 +347,6 @@
Dart_Handle send_port = Dart_NewSendPort(service_port);
Dart_SetReturnValue(args, send_port);
}
- Dart_ExitScope();
}
« no previous file with comments | « runtime/bin/crypto.cc ('k') | runtime/bin/eventhandler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698