diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-05 21:44:13 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-05 21:44:13 +0000 |
commit | 962dd31f9cff7017d90da505e077ea84db9c5e48 (patch) | |
tree | 821a70988ea4e963be58314c5b9b7becab7312fe /base/process_util.h | |
parent | 3115504c55a338fb3de3684a85b2383b4c4dbbc0 (diff) | |
download | chromium_src-962dd31f9cff7017d90da505e077ea84db9c5e48.zip chromium_src-962dd31f9cff7017d90da505e077ea84db9c5e48.tar.gz chromium_src-962dd31f9cff7017d90da505e077ea84db9c5e48.tar.bz2 |
Implement NamedProcessIterator in base/process_util_mac.mm. Patch by Naoki
Takano <takano.naoki@gmail.com>
Review URL: http://codereview.chromium.org/18192
Review URL: http://codereview.chromium.org/21097
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9263 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util.h')
-rw-r--r-- | base/process_util.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/base/process_util.h b/base/process_util.h index ec858bd..8c4c5d4 100644 --- a/base/process_util.h +++ b/base/process_util.h @@ -20,6 +20,7 @@ #endif #include <string> +#include <vector> #include "base/command_line.h" #include "base/process.h" @@ -28,10 +29,11 @@ typedef PROCESSENTRY32 ProcessEntry; typedef IO_COUNTERS IoCounters; #elif defined(OS_POSIX) +// TODO(port): we should not rely on a Win32 structure. struct ProcessEntry { int pid; int ppid; - char szExeFile[NAME_MAX+1]; + char szExeFile[NAME_MAX + 1]; }; struct IoCounters { @@ -44,6 +46,10 @@ struct IoCounters { }; #endif +#if defined(OS_MACOSX) +struct kinfo_proc; +#endif + namespace base { // A minimalistic but hopefully cross-platform set of exit codes. @@ -215,9 +221,9 @@ class NamedProcessIterator { #elif defined(OS_LINUX) DIR *procfs_dir_; #elif defined(OS_MACOSX) - // probably kvm_t *kvmd_; + std::vector<kinfo_proc> kinfo_procs_; + size_t index_of_kinfo_proc_; #endif - ProcessEntry entry_; const ProcessFilter* filter_; |