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

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

Issue 10441078: Add test that passes invalid arguments to socket methods and fix (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 | « no previous file | runtime/bin/socket.cc » ('j') | runtime/bin/socket.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/process.h" 6 #include "bin/process.h"
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 9
10 // Extract an array of C strings from a list of Dart strings. 10 // Extract an array of C strings from a list of Dart strings.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 Dart_Handle environment = Dart_GetNativeArgument(args, 4); 89 Dart_Handle environment = Dart_GetNativeArgument(args, 4);
90 intptr_t environment_length = 0; 90 intptr_t environment_length = 0;
91 char** string_environment = NULL; 91 char** string_environment = NULL;
92 if (!Dart_IsNull(environment)) { 92 if (!Dart_IsNull(environment)) {
93 string_environment = 93 string_environment =
94 ExtractCStringList(environment, 94 ExtractCStringList(environment,
95 status_handle, 95 status_handle,
96 "Environment values must be builtin strings", 96 "Environment values must be builtin strings",
97 &environment_length); 97 &environment_length);
98 if (string_environment == NULL) { 98 if (string_environment == NULL) {
99 delete[] string_args;
99 Dart_SetReturnValue(args, Dart_NewBoolean(false)); 100 Dart_SetReturnValue(args, Dart_NewBoolean(false));
100 Dart_ExitScope(); 101 Dart_ExitScope();
101 return; 102 return;
102 } 103 }
103 } 104 }
104 Dart_Handle in_handle = Dart_GetNativeArgument(args, 5); 105 Dart_Handle in_handle = Dart_GetNativeArgument(args, 5);
105 Dart_Handle out_handle = Dart_GetNativeArgument(args, 6); 106 Dart_Handle out_handle = Dart_GetNativeArgument(args, 6);
106 Dart_Handle err_handle = Dart_GetNativeArgument(args, 7); 107 Dart_Handle err_handle = Dart_GetNativeArgument(args, 7);
107 Dart_Handle exit_handle = Dart_GetNativeArgument(args, 8); 108 Dart_Handle exit_handle = Dart_GetNativeArgument(args, 8);
108 intptr_t pid = -1; 109 intptr_t pid = -1;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 } 144 }
144 145
145 146
146 void FUNCTION_NAME(Process_Kill)(Dart_NativeArguments args) { 147 void FUNCTION_NAME(Process_Kill)(Dart_NativeArguments args) {
147 Dart_EnterScope(); 148 Dart_EnterScope();
148 intptr_t pid = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 1)); 149 intptr_t pid = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 1));
149 bool success = Process::Kill(pid); 150 bool success = Process::Kill(pid);
150 Dart_SetReturnValue(args, Dart_NewBoolean(success)); 151 Dart_SetReturnValue(args, Dart_NewBoolean(success));
151 Dart_ExitScope(); 152 Dart_ExitScope();
152 } 153 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/socket.cc » ('j') | runtime/bin/socket.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698