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

Unified Diff: runtime/bin/platform.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/filter_unsupported.cc ('k') | runtime/bin/process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/platform.cc
===================================================================
--- runtime/bin/platform.cc (revision 25822)
+++ runtime/bin/platform.cc (working copy)
@@ -13,28 +13,21 @@
namespace bin {
void FUNCTION_NAME(Platform_NumberOfProcessors)(Dart_NativeArguments args) {
- Dart_EnterScope();
Dart_SetReturnValue(args, Dart_NewInteger(Platform::NumberOfProcessors()));
- Dart_ExitScope();
}
void FUNCTION_NAME(Platform_OperatingSystem)(Dart_NativeArguments args) {
- Dart_EnterScope();
Dart_SetReturnValue(args, DartUtils::NewString(Platform::OperatingSystem()));
- Dart_ExitScope();
}
void FUNCTION_NAME(Platform_PathSeparator)(Dart_NativeArguments args) {
- Dart_EnterScope();
Dart_SetReturnValue(args, DartUtils::NewString(File::PathSeparator()));
- Dart_ExitScope();
}
void FUNCTION_NAME(Platform_LocalHostname)(Dart_NativeArguments args) {
- Dart_EnterScope();
const intptr_t HOSTNAME_LENGTH = 256;
char hostname[HOSTNAME_LENGTH];
if (Platform::LocalHostname(hostname, HOSTNAME_LENGTH)) {
@@ -42,12 +35,10 @@
} else {
Dart_SetReturnValue(args, DartUtils::NewDartOSError());
}
- Dart_ExitScope();
}
void FUNCTION_NAME(Platform_Environment)(Dart_NativeArguments args) {
- Dart_EnterScope();
intptr_t count = 0;
char** env = Platform::Environment(&count);
if (env == NULL) {
@@ -76,14 +67,11 @@
Platform::FreeEnvironment(env, count);
Dart_SetReturnValue(args, result);
}
- Dart_ExitScope();
}
void FUNCTION_NAME(Platform_GetVersion)(Dart_NativeArguments args) {
- Dart_EnterScope();
Dart_SetReturnValue(args, Dart_NewStringFromCString(Dart_VersionString()));
- Dart_ExitScope();
}
} // namespace bin
« no previous file with comments | « runtime/bin/filter_unsupported.cc ('k') | runtime/bin/process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698