| 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 | 6 |
| 7 #include <sys/sysctl.h> | 7 #include <sys/sysctl.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 | 13 |
| 14 ProcessIterator::ProcessIterator(const ProcessFilter* filter) | 14 ProcessIterator::ProcessIterator(const ProcessFilter* filter) |
| 15 : index_of_kinfo_proc_(), | 15 : index_of_kinfo_proc_(), |
| 16 filter_(filter) { | 16 filter_(filter) { |
| 17 | 17 |
| 18 int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, getuid() }; | 18 int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_UID, getuid() }; |
| 19 | 19 |
| 20 bool done = false; | 20 bool done = false; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 | 116 |
| 117 bool NamedProcessIterator::IncludeEntry() { | 117 bool NamedProcessIterator::IncludeEntry() { |
| 118 if (executable_name_ != entry().exe_file()) | 118 if (executable_name_ != entry().exe_file()) |
| 119 return false; | 119 return false; |
| 120 | 120 |
| 121 return ProcessIterator::IncludeEntry(); | 121 return ProcessIterator::IncludeEntry(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace base | 124 } // namespace base |
| OLD | NEW |