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

Unified Diff: base/process.h

Issue 10895: Add Terminate() to the Process object, have RenderProcessHost use this to avo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/multiprocess_test.h ('k') | base/process_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process.h
===================================================================
--- base/process.h (revision 5371)
+++ base/process.h (working copy)
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_PROCESS_H__
-#define BASE_PROCESS_H__
+#ifndef BASE_PROCESS_H_
+#define BASE_PROCESS_H_
#include "base/basictypes.h"
@@ -11,6 +11,8 @@
#include <windows.h>
#endif
+namespace base {
+
// ProcessHandle is a platform specific type which represents the underlying OS
// handle to a process.
#if defined(OS_WIN)
@@ -20,9 +22,6 @@
typedef int ProcessHandle;
#endif
-// A Process
-// TODO(mbelshe): Replace existing code which uses the ProcessHandle w/ the
-// Process object where relevant.
class Process {
public:
Process() : process_(0), last_working_set_size_(0) {}
@@ -43,14 +42,14 @@
// Is the this process the current process.
bool is_current() const;
- // Close the Process Handle.
- void Close() {
-#ifdef OS_WIN
- CloseHandle(process_);
-#endif
- process_ = 0;
- }
+ // Close the process handle. This will not terminate the process.
+ void Close();
+ // Terminates the process with extreme prejudice. The given result code will
+ // be the exit code of the process. If the process has already exited, this
+ // will do nothing.
+ void Terminate(int result_code);
+
// A process is backgrounded when it's priority is lower than normal.
// Return true if this process is backgrounded, false otherwise.
bool IsProcessBackgrounded() const;
@@ -85,5 +84,7 @@
size_t last_working_set_size_;
};
-#endif // BASE_PROCESS_H__
+} // namespace base
+#endif // BASE_PROCESS_H_
+
« no previous file with comments | « base/multiprocess_test.h ('k') | base/process_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698