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

Side by Side Diff: base/process_util_linux.cc

Issue 10914279: Cleanup: Add a const variable for /proc/self/exe. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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_util.h ('k') | chrome/test/base/chrome_test_suite.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « base/process_util.h ('k') | chrome/test/base/chrome_test_suite.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698