OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/process_iterator.h" | 5 #include "base/process/process_iterator.h" |
| 6 #include "build/build_config.h" |
6 | 7 |
7 namespace base { | 8 namespace base { |
8 | 9 |
9 #if defined(OS_POSIX) | 10 #if defined(OS_POSIX) |
10 ProcessEntry::ProcessEntry() : pid_(0), ppid_(0), gid_(0) {} | 11 ProcessEntry::ProcessEntry() : pid_(0), ppid_(0), gid_(0) {} |
11 ProcessEntry::~ProcessEntry() {} | 12 ProcessEntry::~ProcessEntry() {} |
12 #endif | 13 #endif |
13 | 14 |
14 const ProcessEntry* ProcessIterator::NextProcessEntry() { | 15 const ProcessEntry* ProcessIterator::NextProcessEntry() { |
15 bool result = false; | 16 bool result = false; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 int GetProcessCount(const FilePath::StringType& executable_name, | 57 int GetProcessCount(const FilePath::StringType& executable_name, |
57 const ProcessFilter* filter) { | 58 const ProcessFilter* filter) { |
58 int count = 0; | 59 int count = 0; |
59 NamedProcessIterator iter(executable_name, filter); | 60 NamedProcessIterator iter(executable_name, filter); |
60 while (iter.NextProcessEntry()) | 61 while (iter.NextProcessEntry()) |
61 ++count; | 62 ++count; |
62 return count; | 63 return count; |
63 } | 64 } |
64 | 65 |
65 } // namespace base | 66 } // namespace base |
OLD | NEW |