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

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

Issue 105083009: Revert "Signal handling." (Closed) Base URL: https://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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/process.h ('k') | runtime/bin/process_android.cc » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/io_buffer.h" 6 #include "bin/io_buffer.h"
7 #include "bin/platform.h" 7 #include "bin/platform.h"
8 #include "bin/process.h" 8 #include "bin/process.h"
9 #include "bin/socket.h" 9 #include "bin/socket.h"
10 10
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 Dart_Handle process = Dart_GetNativeArgument(args, 0); 236 Dart_Handle process = Dart_GetNativeArgument(args, 0);
237 if (Dart_IsNull(process)) { 237 if (Dart_IsNull(process)) {
238 pid = Process::CurrentProcessId(); 238 pid = Process::CurrentProcessId();
239 } else { 239 } else {
240 Process::GetProcessIdNativeField(process, &pid); 240 Process::GetProcessIdNativeField(process, &pid);
241 } 241 }
242 Dart_SetReturnValue(args, Dart_NewInteger(pid)); 242 Dart_SetReturnValue(args, Dart_NewInteger(pid));
243 } 243 }
244 244
245 245
246 void FUNCTION_NAME(Process_SetSignalHandler)(Dart_NativeArguments args) {
247 intptr_t signal = DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 0));
248 intptr_t id = Process::SetSignalHandler(signal);
249 if (id == -1) {
250 Dart_SetReturnValue(args, DartUtils::NewDartOSError());
251 } else {
252 Dart_SetReturnValue(args, Dart_NewInteger(id));
253 }
254 }
255
256
257 void FUNCTION_NAME(Process_ClearSignalHandler)(Dart_NativeArguments args) {
258 intptr_t signal = DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 0));
259 Process::ClearSignalHandler(signal);
260 }
261
262
263 Dart_Handle Process::GetProcessIdNativeField(Dart_Handle process, 246 Dart_Handle Process::GetProcessIdNativeField(Dart_Handle process,
264 intptr_t* pid) { 247 intptr_t* pid) {
265 return Dart_GetNativeInstanceField(process, kProcessIdNativeField, pid); 248 return Dart_GetNativeInstanceField(process, kProcessIdNativeField, pid);
266 } 249 }
267 250
268 251
269 Dart_Handle Process::SetProcessIdNativeField(Dart_Handle process, 252 Dart_Handle Process::SetProcessIdNativeField(Dart_Handle process,
270 intptr_t pid) { 253 intptr_t pid) {
271 return Dart_SetNativeInstanceField(process, kProcessIdNativeField, pid); 254 return Dart_SetNativeInstanceField(process, kProcessIdNativeField, pid);
272 } 255 }
(...skipping 25 matching lines...) Expand all
298 int external_length = strlen(system_string); 281 int external_length = strlen(system_string);
299 uint8_t* buffer = NULL; 282 uint8_t* buffer = NULL;
300 Dart_Handle external_array = IOBuffer::Allocate(external_length, &buffer); 283 Dart_Handle external_array = IOBuffer::Allocate(external_length, &buffer);
301 memmove(buffer, system_string, external_length); 284 memmove(buffer, system_string, external_length);
302 if (utf8 != system_string) free(const_cast<char*>(system_string)); 285 if (utf8 != system_string) free(const_cast<char*>(system_string));
303 Dart_SetReturnValue(args, external_array); 286 Dart_SetReturnValue(args, external_array);
304 } 287 }
305 288
306 } // namespace bin 289 } // namespace bin
307 } // namespace dart 290 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/process.h ('k') | runtime/bin/process_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698