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

Unified Diff: base/process_util.h

Issue 8880: Port GetProcessCount(), KillProcesses(), and CleanupProcesses().... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 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_util_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util.h
===================================================================
--- base/process_util.h (revision 4223)
+++ base/process_util.h (working copy)
@@ -10,9 +10,13 @@
#include "base/basictypes.h"
-#ifdef OS_WIN
+#if defined(OS_WIN)
#include <windows.h>
#include <tlhelp32.h>
+#elif defined(OS_LINUX)
+#include <dirent.h>
+#include <limits.h>
+#include <sys/types.h>
#endif
#include <string>
@@ -24,7 +28,12 @@
typedef PROCESSENTRY32 ProcessEntry;
typedef IO_COUNTERS IoCounters;
#elif defined(OS_POSIX)
-typedef int ProcessEntry;
+struct ProcessEntry {
+ int pid;
+ int ppid;
+ char szExeFile[NAME_MAX+1];
+};
+
struct IoCounters {
unsigned long long ReadOperationCount;
unsigned long long WriteOperationCount;
@@ -172,10 +181,16 @@
void InitProcessEntry(ProcessEntry* entry);
std::wstring executable_name_;
-#ifdef OS_WIN
+
+#if defined(OS_WIN)
HANDLE snapshot_;
+ bool started_iteration_;
+#elif defined(OS_LINUX)
+ DIR *procfs_dir_;
+#elif defined(OS_MACOSX)
+ // probably kvm_t *kvmd_;
#endif
- bool started_iteration_;
+
ProcessEntry entry_;
const ProcessFilter* filter_;
« no previous file with comments | « no previous file | base/process_util_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698