OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef BASE_PROCESS_PROCESS_PROCESS_H_ | 5 #ifndef BASE_PROCESS_PROCESS_PROCESS_H_ |
6 #define BASE_PROCESS_PROCESS_PROCESS_H_ | 6 #define BASE_PROCESS_PROCESS_PROCESS_H_ |
7 | 7 |
8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/move.h" | 10 #include "base/move.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // Close the process handle. This will not terminate the process. | 91 // Close the process handle. This will not terminate the process. |
92 void Close(); | 92 void Close(); |
93 | 93 |
94 // Terminates the process with extreme prejudice. The given |result_code| will | 94 // Terminates the process with extreme prejudice. The given |result_code| will |
95 // be the exit code of the process. | 95 // be the exit code of the process. |
96 // NOTE: On POSIX |result_code| is ignored. | 96 // NOTE: On POSIX |result_code| is ignored. |
97 void Terminate(int result_code); | 97 void Terminate(int result_code); |
98 | 98 |
99 // Waits for the process to exit. Returns true on success. | 99 // Waits for the process to exit. Returns true on success. |
100 // On POSIX, if the process has been signaled then |exit_code| is set to -1. | 100 // On POSIX, if the process has been signaled then |exit_code| is set to -1. |
| 101 // On Linux this must be a child process, however on Mac and Windows it can be |
| 102 // any process. |
101 bool WaitForExit(int* exit_code); | 103 bool WaitForExit(int* exit_code); |
102 | 104 |
103 // Same as WaitForExit() but only waits for up to |timeout|. | 105 // Same as WaitForExit() but only waits for up to |timeout|. |
104 bool WaitForExitWithTimeout(TimeDelta timeout, int* exit_code); | 106 bool WaitForExitWithTimeout(TimeDelta timeout, int* exit_code); |
105 | 107 |
106 // A process is backgrounded when it's priority is lower than normal. | 108 // A process is backgrounded when it's priority is lower than normal. |
107 // Return true if this process is backgrounded, false otherwise. | 109 // Return true if this process is backgrounded, false otherwise. |
108 bool IsProcessBackgrounded() const; | 110 bool IsProcessBackgrounded() const; |
109 | 111 |
110 // Set a process as backgrounded. If value is true, the priority of the | 112 // Set a process as backgrounded. If value is true, the priority of the |
(...skipping 11 matching lines...) Expand all Loading... |
122 bool is_current_process_; | 124 bool is_current_process_; |
123 win::ScopedHandle process_; | 125 win::ScopedHandle process_; |
124 #else | 126 #else |
125 ProcessHandle process_; | 127 ProcessHandle process_; |
126 #endif | 128 #endif |
127 }; | 129 }; |
128 | 130 |
129 } // namespace base | 131 } // namespace base |
130 | 132 |
131 #endif // BASE_PROCESS_PROCESS_PROCESS_H_ | 133 #endif // BASE_PROCESS_PROCESS_PROCESS_H_ |
OLD | NEW |