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

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

Issue 10545134: Give Process.kill an optional argument to specify which signal to send. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changes based on ager's review. 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
« runtime/bin/process_impl.dart ('K') | « runtime/bin/process_macos.cc ('k') | no next file » | 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) 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 <process.h> 5 #include <process.h>
6 6
7 #include "bin/builtin.h" 7 #include "bin/builtin.h"
8 #include "bin/process.h" 8 #include "bin/process.h"
9 #include "bin/eventhandler.h" 9 #include "bin/eventhandler.h"
10 #include "bin/thread.h" 10 #include "bin/thread.h"
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 *exit_handler = reinterpret_cast<intptr_t>(exit_handle); 493 *exit_handler = reinterpret_cast<intptr_t>(exit_handle);
494 494
495 CloseHandle(process_info.hThread); 495 CloseHandle(process_info.hThread);
496 496
497 // Return process id. 497 // Return process id.
498 *id = process_info.dwProcessId; 498 *id = process_info.dwProcessId;
499 return 0; 499 return 0;
500 } 500 }
501 501
502 502
503 bool Process::Kill(intptr_t id) { 503 bool Process::Kill(intptr_t id, int signal) {
504 // signal is not used on windows.
504 HANDLE process_handle; 505 HANDLE process_handle;
505 HANDLE wait_handle; 506 HANDLE wait_handle;
506 HANDLE exit_pipe; 507 HANDLE exit_pipe;
507 bool success = ProcessInfoList::LookupProcess(id, 508 bool success = ProcessInfoList::LookupProcess(id,
508 &process_handle, 509 &process_handle,
509 &wait_handle, 510 &wait_handle,
510 &exit_pipe); 511 &exit_pipe);
511 ASSERT(success); 512 ASSERT(success);
512 BOOL result = TerminateProcess(process_handle, -1); 513 BOOL result = TerminateProcess(process_handle, -1);
513 if (!result) { 514 if (!result) {
514 return false; 515 return false;
515 } 516 }
516 return true; 517 return true;
517 } 518 }
518 519
519 520
520 void Process::TerminateExitCodeHandler() { 521 void Process::TerminateExitCodeHandler() {
521 // Nothing needs to be done on Windows. 522 // Nothing needs to be done on Windows.
522 } 523 }
523 524
OLDNEW
« runtime/bin/process_impl.dart ('K') | « runtime/bin/process_macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698