| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/internal_linux.h" | 5 #include "base/process/internal_linux.h" |
| 6 | 6 |
| 7 #include <unistd.h> | 7 #include <unistd.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/string_util.h" | |
| 15 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 16 #include "base/strings/string_split.h" | 15 #include "base/strings/string_split.h" |
| 16 #include "base/strings/string_util.h" |
| 17 #include "base/threading/thread_restrictions.h" | 17 #include "base/threading/thread_restrictions.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 namespace internal { | 20 namespace internal { |
| 21 | 21 |
| 22 const char kProcDir[] = "/proc"; | 22 const char kProcDir[] = "/proc"; |
| 23 | 23 |
| 24 const char kStatFile[] = "stat"; | 24 const char kStatFile[] = "stat"; |
| 25 | 25 |
| 26 base::FilePath GetProcPidDir(pid_t pid) { | 26 base::FilePath GetProcPidDir(pid_t pid) { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 if (!ReadProcStats(pid, &stats_data)) | 133 if (!ReadProcStats(pid, &stats_data)) |
| 134 return 0; | 134 return 0; |
| 135 std::vector<std::string> proc_stats; | 135 std::vector<std::string> proc_stats; |
| 136 if (!ParseProcStats(stats_data, &proc_stats)) | 136 if (!ParseProcStats(stats_data, &proc_stats)) |
| 137 return 0; | 137 return 0; |
| 138 return GetProcStatsFieldAsSizeT(proc_stats, field_num); | 138 return GetProcStatsFieldAsSizeT(proc_stats, field_num); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace internal | 141 } // namespace internal |
| 142 } // namespace base | 142 } // namespace base |
| OLD | NEW |