summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpaulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-06 01:04:18 +0000
committerpaulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-06 01:04:18 +0000
commit6165906b8ae55cb5ea25923ca42d76d88b358bd4 (patch)
tree4c087e51bded2816f06efddc746b550195151e66
parent2008f1b6246c718c83d60ea2575273688c2d7aea (diff)
downloadchromium_src-6165906b8ae55cb5ea25923ca42d76d88b358bd4.zip
chromium_src-6165906b8ae55cb5ea25923ca42d76d88b358bd4.tar.gz
chromium_src-6165906b8ae55cb5ea25923ca42d76d88b358bd4.tar.bz2
Bring in more files from the mac july branch.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@412 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/process.h11
-rw-r--r--base/process_util.h20
2 files changed, 19 insertions, 12 deletions
diff --git a/base/process.h b/base/process.h
index b8ea94f..5c07442 100644
--- a/base/process.h
+++ b/base/process.h
@@ -30,14 +30,17 @@
#ifndef BASE_PROCESS_H__
#define BASE_PROCESS_H__
-#include <windows.h>
#include "base/basictypes.h"
+#ifdef OS_WIN
+#include <windows.h>
+#endif
+
// ProcessHandle is a platform specific type which represents the underlying OS
// handle to a process.
-#ifdef WIN32
+#if defined(OS_WIN)
typedef HANDLE ProcessHandle;
-#else
+#elif defined(OS_POSIX)
typedef int ProcessHandle;
#endif
@@ -65,7 +68,9 @@ class Process {
// Close the Process Handle.
void Close() {
+#ifdef OS_WIN
CloseHandle(process_);
+#endif
process_ = 0;
}
diff --git a/base/process_util.h b/base/process_util.h
index 5cabcc5..defa561 100644
--- a/base/process_util.h
+++ b/base/process_util.h
@@ -33,23 +33,25 @@
#ifndef BASE_PROCESS_UTIL_H__
#define BASE_PROCESS_UTIL_H__
-#include <string>
-#ifdef WIN32
+#include "base/basictypes.h"
+
+#ifdef OS_WIN
#include <windows.h>
#include <tlhelp32.h>
-#endif // WIN32
+#endif
+
+#include <string>
-#include "base/basictypes.h"
#include "base/process.h"
// ProcessHandle is a platform specific type which represents the underlying OS
// handle to a process.
-#ifdef WIN32
+#if defined(OS_WIN)
typedef PROCESSENTRY32 ProcessEntry;
typedef IO_COUNTERS IoCounters;
-#else
+#elif defined(OS_POSIX)
typedef int ProcessEntry;
-typedef int IoCounters; //TODO(awalker): replace with struct when available
+typedef int IoCounters; //TODO(awalker): replace with struct when available
#endif
namespace process_util {
@@ -161,9 +163,9 @@ class NamedProcessIterator {
void InitProcessEntry(ProcessEntry* entry);
std::wstring executable_name_;
-#ifdef WIN32
+#ifdef OS_WIN
HANDLE snapshot_;
-#endif // WIN32
+#endif
bool started_iteration_;
ProcessEntry entry_;
const ProcessFilter* filter_;