Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Side by Side Diff: base/process_util_linux.cc

Issue 19519008: Move the remaning base/process* files into base/process/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/process_posix.cc ('k') | base/process_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
Robert Sesek 2013/07/18 14:43:54 I forgot to remove this file in my previous CL, th
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/process_util.h"
6
7 #include <dirent.h>
8 #include <malloc.h>
9 #include <sys/time.h>
10 #include <sys/types.h>
11 #include <unistd.h>
12
13 #include "base/file_util.h"
14 #include "base/logging.h"
15 #include "base/process/internal_linux.h"
16 #include "base/strings/string_number_conversions.h"
17 #include "base/strings/string_split.h"
18 #include "base/strings/string_util.h"
19 #include "base/sys_info.h"
20 #include "base/threading/thread_restrictions.h"
21
22 namespace base {
23
24 size_t g_oom_size = 0U;
25
26 const char kProcSelfExe[] = "/proc/self/exe";
27
28 ProcessId GetParentProcessId(ProcessHandle process) {
29 ProcessId pid =
30 internal::ReadProcStatsAndGetFieldAsInt(process, internal::VM_PPID);
31 if (pid)
32 return pid;
33 return -1;
34 }
35
36 FilePath GetProcessExecutablePath(ProcessHandle process) {
37 FilePath stat_file = internal::GetProcPidDir(process).Append("exe");
38 FilePath exe_name;
39 if (!file_util::ReadSymbolicLink(stat_file, &exe_name)) {
40 // No such process. Happens frequently in e.g. TerminateAllChromeProcesses
41 return FilePath();
42 }
43 return exe_name;
44 }
45
46 int GetNumberOfThreads(ProcessHandle process) {
47 return internal::ReadProcStatsAndGetFieldAsInt(process,
48 internal::VM_NUMTHREADS);
49 }
50
51 } // namespace base
OLDNEW
« no previous file with comments | « base/process_posix.cc ('k') | base/process_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698