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

Side by Side Diff: runtime/bin/directory.cc

Issue 8799009: Add support for client/dartc compilation only tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/bin/directory.dart » ('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 "bin/dartutils.h" 5 #include "bin/dartutils.h"
6 #include "bin/directory.h" 6 #include "bin/directory.h"
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 9
10 static intptr_t GetHandlerPort(Dart_Handle handle) { 10 static intptr_t GetHandlerPort(Dart_Handle handle) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 Dart_SetReturnValue(args, Dart_NewBoolean(created)); 71 Dart_SetReturnValue(args, Dart_NewBoolean(created));
72 } else { 72 } else {
73 Dart_SetReturnValue(args, Dart_NewBoolean(false)); 73 Dart_SetReturnValue(args, Dart_NewBoolean(false));
74 } 74 }
75 Dart_ExitScope(); 75 Dart_ExitScope();
76 } 76 }
77 77
78 78
79 void FUNCTION_NAME(Directory_CreateTemp)(Dart_NativeArguments args) { 79 void FUNCTION_NAME(Directory_CreateTemp)(Dart_NativeArguments args) {
80 Dart_EnterScope(); 80 Dart_EnterScope();
81 Dart_Handle path = Dart_GetNativeArgument(args, 1); 81 Dart_Handle path = Dart_GetNativeArgument(args, 0);
82 Dart_Handle number = Dart_GetNativeArgument(args, 2); 82 Dart_Handle number = Dart_GetNativeArgument(args, 1);
83 if (Dart_IsString(path) && Dart_IsInteger(number)) { 83 if (Dart_IsString(path) && Dart_IsInteger(number)) {
84 char* result = Directory::CreateTemp(DartUtils::GetStringValue(path), 84 char* result = Directory::CreateTemp(DartUtils::GetStringValue(path),
85 DartUtils::GetIntegerValue(number)); 85 DartUtils::GetIntegerValue(number));
86 Dart_SetReturnValue(args, Dart_NewString(result)); 86 Dart_SetReturnValue(args, Dart_NewString(result));
87 free(result); 87 free(result);
88 } else { 88 } else {
89 Dart_SetReturnValue(args, Dart_NewString("")); 89 Dart_SetReturnValue(args, Dart_NewString(""));
90 } 90 }
91 Dart_ExitScope(); 91 Dart_ExitScope();
92 } 92 }
93 93
94 94
95 void FUNCTION_NAME(Directory_Delete)(Dart_NativeArguments args) { 95 void FUNCTION_NAME(Directory_Delete)(Dart_NativeArguments args) {
96 Dart_EnterScope(); 96 Dart_EnterScope();
97 Dart_Handle path = Dart_GetNativeArgument(args, 1); 97 Dart_Handle path = Dart_GetNativeArgument(args, 1);
98 if (Dart_IsString(path)) { 98 if (Dart_IsString(path)) {
99 bool deleted = Directory::Delete(DartUtils::GetStringValue(path)); 99 bool deleted = Directory::Delete(DartUtils::GetStringValue(path));
100 Dart_SetReturnValue(args, Dart_NewBoolean(deleted)); 100 Dart_SetReturnValue(args, Dart_NewBoolean(deleted));
101 } else { 101 } else {
102 Dart_SetReturnValue(args, Dart_NewBoolean(false)); 102 Dart_SetReturnValue(args, Dart_NewBoolean(false));
103 } 103 }
104 Dart_ExitScope(); 104 Dart_ExitScope();
105 } 105 }
OLDNEW
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/bin/directory.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698