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

Unified Diff: base/process.h

Issue 57062: Use portable typedef for PIDs (process IDs). (Closed)
Patch Set: speculative fix for win Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | 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
diff --git a/base/process.h b/base/process.h
index de269397522cea0339b0c06a62ced37a5c0ad99f..312f84cacf855e6ef02abe3c61904684c9c2fd19 100644
--- a/base/process.h
+++ b/base/process.h
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
+#include <sys/types.h>
#ifdef OS_WIN
#include <windows.h>
#endif
@@ -15,11 +16,14 @@ namespace base {
// ProcessHandle is a platform specific type which represents the underlying OS
// handle to a process.
+// ProcessId is a number which identifies the process in the OS.
#if defined(OS_WIN)
typedef HANDLE ProcessHandle;
+typedef DWORD ProcessId;
#elif defined(OS_POSIX)
// On POSIX, our ProcessHandle will just be the PID.
-typedef int ProcessHandle;
+typedef pid_t ProcessHandle;
+typedef pid_t ProcessId;
#endif
class Process {
@@ -37,7 +41,7 @@ class Process {
void set_handle(ProcessHandle handle) { process_ = handle; }
// Get the PID for this process.
- int32 pid() const;
+ ProcessId pid() const;
// Is the this process the current process.
bool is_current() const;
« no previous file with comments | « no previous file | base/process_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698