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

Side by Side Diff: base/process/process.h

Issue 983963002: Redefine base::Process:Terminate so that it can replace base::KillProcess (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « ash/test/test_metro_viewer_process_host.cc ('k') | base/process/process_posix.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) 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // Get the PID for this process. 85 // Get the PID for this process.
86 ProcessId Pid() const; 86 ProcessId Pid() const;
87 87
88 // Returns true if this process is the current process. 88 // Returns true if this process is the current process.
89 bool is_current() const; 89 bool is_current() const;
90 90
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. if |wait| is true, this method will wait
rvargas (doing something else) 2015/03/06 19:57:08 will upper case if.
96 // for up to one minute for the process to actually terminate.
97 // Returns true if the process terminates within the allowed time.
96 // NOTE: On POSIX |result_code| is ignored. 98 // NOTE: On POSIX |result_code| is ignored.
97 void Terminate(int result_code); 99 bool Terminate(int result_code, bool wait);
98 100
99 // Waits for the process to exit. Returns true on success. 101 // 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. 102 // 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 103 // On Linux this must be a child process, however on Mac and Windows it can be
102 // any process. 104 // any process.
103 bool WaitForExit(int* exit_code); 105 bool WaitForExit(int* exit_code);
104 106
105 // Same as WaitForExit() but only waits for up to |timeout|. 107 // Same as WaitForExit() but only waits for up to |timeout|.
106 bool WaitForExitWithTimeout(TimeDelta timeout, int* exit_code); 108 bool WaitForExitWithTimeout(TimeDelta timeout, int* exit_code);
107 109
(...skipping 16 matching lines...) Expand all
124 bool is_current_process_; 126 bool is_current_process_;
125 win::ScopedHandle process_; 127 win::ScopedHandle process_;
126 #else 128 #else
127 ProcessHandle process_; 129 ProcessHandle process_;
128 #endif 130 #endif
129 }; 131 };
130 132
131 } // namespace base 133 } // namespace base
132 134
133 #endif // BASE_PROCESS_PROCESS_PROCESS_H_ 135 #endif // BASE_PROCESS_PROCESS_PROCESS_H_
OLDNEW
« no previous file with comments | « ash/test/test_metro_viewer_process_host.cc ('k') | base/process/process_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698