OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/process_util.h" | 5 #include "base/process_util.h" |
6 | 6 |
7 namespace base { | 7 namespace base { |
8 | 8 |
| 9 #if defined(OS_LINUX) |
| 10 // Definition for exported constant defined in header. This is used |
| 11 // to pass the oom score to the setuid sandbox. |
| 12 const char kAdjustOOMScoreSwitch[] = "--adjust-oom-score"; |
| 13 #endif |
| 14 |
9 #if defined(OS_POSIX) | 15 #if defined(OS_POSIX) |
10 ProcessEntry::ProcessEntry() : pid_(0), ppid_(0), gid_(0) {} | 16 ProcessEntry::ProcessEntry() : pid_(0), ppid_(0), gid_(0) {} |
11 ProcessEntry::~ProcessEntry() {} | 17 ProcessEntry::~ProcessEntry() {} |
12 #endif | 18 #endif |
13 | 19 |
14 int GetProcessCount(const FilePath::StringType& executable_name, | 20 int GetProcessCount(const FilePath::StringType& executable_name, |
15 const ProcessFilter* filter) { | 21 const ProcessFilter* filter) { |
16 int count = 0; | 22 int count = 0; |
17 NamedProcessIterator iter(executable_name, filter); | 23 NamedProcessIterator iter(executable_name, filter); |
18 while (iter.NextProcessEntry()) | 24 while (iter.NextProcessEntry()) |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 NamedProcessIterator::NamedProcessIterator( | 65 NamedProcessIterator::NamedProcessIterator( |
60 const FilePath::StringType& executable_name, | 66 const FilePath::StringType& executable_name, |
61 const ProcessFilter* filter) : ProcessIterator(filter), | 67 const ProcessFilter* filter) : ProcessIterator(filter), |
62 executable_name_(executable_name) { | 68 executable_name_(executable_name) { |
63 } | 69 } |
64 | 70 |
65 NamedProcessIterator::~NamedProcessIterator() { | 71 NamedProcessIterator::~NamedProcessIterator() { |
66 } | 72 } |
67 | 73 |
68 } // namespace base | 74 } // namespace base |
OLD | NEW |