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_util.h" | 5 #include "base/process_util.h" |
6 | 6 |
7 #include <dirent.h> | 7 #include <dirent.h> |
8 #include <malloc.h> | 8 #include <malloc.h> |
9 #include <sys/time.h> | 9 #include <sys/time.h> |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 } | 281 } |
282 | 282 |
283 } // namespace | 283 } // namespace |
284 | 284 |
285 namespace base { | 285 namespace base { |
286 | 286 |
287 #if defined(USE_LINUX_BREAKPAD) | 287 #if defined(USE_LINUX_BREAKPAD) |
288 size_t g_oom_size = 0U; | 288 size_t g_oom_size = 0U; |
289 #endif | 289 #endif |
290 | 290 |
| 291 const char kProcSelfExe[] = "/proc/self/exe"; |
| 292 |
291 ProcessId GetParentProcessId(ProcessHandle process) { | 293 ProcessId GetParentProcessId(ProcessHandle process) { |
292 ProcessId pid = ReadProcStatsAndGetFieldAsInt(process, VM_PPID); | 294 ProcessId pid = ReadProcStatsAndGetFieldAsInt(process, VM_PPID); |
293 if (pid) | 295 if (pid) |
294 return pid; | 296 return pid; |
295 return -1; | 297 return -1; |
296 } | 298 } |
297 | 299 |
298 FilePath GetProcessExecutablePath(ProcessHandle process) { | 300 FilePath GetProcessExecutablePath(ProcessHandle process) { |
299 FilePath stat_file = GetProcPidDir(process).Append("exe"); | 301 FilePath stat_file = GetProcPidDir(process).Append("exe"); |
300 FilePath exe_name; | 302 FilePath exe_name; |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 int score_len = static_cast<int>(score_str.length()); | 826 int score_len = static_cast<int>(score_str.length()); |
825 return (score_len == file_util::WriteFile(oom_file, | 827 return (score_len == file_util::WriteFile(oom_file, |
826 score_str.c_str(), | 828 score_str.c_str(), |
827 score_len)); | 829 score_len)); |
828 } | 830 } |
829 | 831 |
830 return false; | 832 return false; |
831 } | 833 } |
832 | 834 |
833 } // namespace base | 835 } // namespace base |
OLD | NEW |