summaryrefslogtreecommitdiffstats
path: root/base/process_util_posix.cc
diff options
context:
space:
mode:
authorevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-14 20:49:16 +0000
committerevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-14 20:49:16 +0000
commit0b100bc8b653af9c1a12794a7508d1269fafc156 (patch)
treed78f750536d7f60cdf460fdbc5bb39f74e9af29c /base/process_util_posix.cc
parent36b147bd8298c28e8ba4e7ab529b199aa3cce680 (diff)
downloadchromium_src-0b100bc8b653af9c1a12794a7508d1269fafc156.zip
chromium_src-0b100bc8b653af9c1a12794a7508d1269fafc156.tar.gz
chromium_src-0b100bc8b653af9c1a12794a7508d1269fafc156.tar.bz2
Port parts of base/process_util to Linux.
Review URL: http://codereview.chromium.org/6492 Patch from Paweł Hajdan jr <phajdan.jr@gmail.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_posix.cc')
-rw-r--r--base/process_util_posix.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc
index 4d2f1e5..7439979 100644
--- a/base/process_util_posix.cc
+++ b/base/process_util_posix.cc
@@ -8,6 +8,7 @@
#include <unistd.h>
#include "base/basictypes.h"
+#include "base/sys_info.h"
namespace process_util {
@@ -23,6 +24,19 @@ int GetProcId(ProcessHandle process) {
return process;
}
+ProcessMetrics::ProcessMetrics(ProcessHandle process) : process_(process),
+ last_time_(0),
+ last_system_time_(0) {
+ processor_count_ = base::SysInfo::NumberOfProcessors();
+}
+
+// static
+ProcessMetrics* ProcessMetrics::CreateProcessMetrics(ProcessHandle process) {
+ return new ProcessMetrics(process);
+}
+
+ProcessMetrics::~ProcessMetrics() { }
+
void EnableTerminationOnHeapCorruption() {
// On POSIX, there nothing to do AFAIK.
}