OLD | NEW |
---|---|
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/process.h" | 5 #include "base/process.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/process_util.h" | 7 #include "base/process_util.h" |
8 | 8 |
9 namespace base { | 9 namespace base { |
10 | 10 |
11 void Process::Close() { | 11 void Process::Close() { |
12 process_ = 0; | 12 process_ = 0; |
13 // if the process wasn't termiated (so we waited) or the state | |
Evan Stade
2012/06/23 00:04:34
termiNated, capitalize If, don't abbreviate "with"
| |
14 // wasn't already collected w/ a wait from process_utils, we're gonna | |
15 // end up w/ a zombie when it does finally exit. | |
13 } | 16 } |
14 | 17 |
15 void Process::Terminate(int result_code) { | 18 void Process::Terminate(int result_code) { |
16 NOTIMPLEMENTED(); | 19 // result_code isn't supportable. |
Evan Stade
2012/06/23 00:04:34
|result_code|
| |
20 if (!process_) | |
21 return; | |
22 // Wait so we clean up the zombie | |
Evan Stade
2012/06/23 00:04:34
needs trailing period.
| |
23 KillProcess(process_, result_code, true); | |
17 } | 24 } |
18 | 25 |
19 bool Process::IsProcessBackgrounded() const { | 26 bool Process::IsProcessBackgrounded() const { |
20 return false; | 27 return false; |
21 } | 28 } |
22 | 29 |
23 bool Process::SetProcessBackgrounded(bool value) { | 30 bool Process::SetProcessBackgrounded(bool value) { |
24 NOTIMPLEMENTED(); | 31 NOTIMPLEMENTED(); |
25 return false; | 32 return false; |
26 } | 33 } |
(...skipping 23 matching lines...) Expand all Loading... | |
50 bool Process::is_current() const { | 57 bool Process::is_current() const { |
51 return process_ == GetCurrentProcessHandle(); | 58 return process_ == GetCurrentProcessHandle(); |
52 } | 59 } |
53 | 60 |
54 // static | 61 // static |
55 Process Process::Current() { | 62 Process Process::Current() { |
56 return Process(GetCurrentProcessHandle()); | 63 return Process(GetCurrentProcessHandle()); |
57 } | 64 } |
58 | 65 |
59 } // namspace base | 66 } // namspace base |
OLD | NEW |