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

Side by Side Diff: base/process_util.h

Issue 8390002: implement GetProcessExecutablePath() on OpenBSD and start using it (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: return the variable instead Created 9 years, 1 month 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
« no previous file with comments | « base/base_paths_linux.cc ('k') | base/process_util_openbsd.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // This file/namespace contains utility functions for enumerating, ending and 5 // This file/namespace contains utility functions for enumerating, ending and
6 // computing statistics of processes. 6 // computing statistics of processes.
7 7
8 #ifndef BASE_PROCESS_UTIL_H_ 8 #ifndef BASE_PROCESS_UTIL_H_
9 #define BASE_PROCESS_UTIL_H_ 9 #define BASE_PROCESS_UTIL_H_
10 #pragma once 10 #pragma once
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 ProcessHandle* handle); 159 ProcessHandle* handle);
160 160
161 // Closes the process handle opened by OpenProcessHandle. 161 // Closes the process handle opened by OpenProcessHandle.
162 BASE_EXPORT void CloseProcessHandle(ProcessHandle process); 162 BASE_EXPORT void CloseProcessHandle(ProcessHandle process);
163 163
164 // Returns the unique ID for the specified process. This is functionally the 164 // Returns the unique ID for the specified process. This is functionally the
165 // same as Windows' GetProcessId(), but works on versions of Windows before 165 // same as Windows' GetProcessId(), but works on versions of Windows before
166 // Win XP SP1 as well. 166 // Win XP SP1 as well.
167 BASE_EXPORT ProcessId GetProcId(ProcessHandle process); 167 BASE_EXPORT ProcessId GetProcId(ProcessHandle process);
168 168
169 #if defined(OS_LINUX) || defined(OS_ANDROID) 169 #if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_OPENBSD)
170 // Returns the path to the executable of the given process. 170 // Returns the path to the executable of the given process.
171 BASE_EXPORT FilePath GetProcessExecutablePath(ProcessHandle process); 171 BASE_EXPORT FilePath GetProcessExecutablePath(ProcessHandle process);
172 #endif
172 173
174 #if defined(OS_LINUX) || defined(OS_ANDROID)
173 // Parse the data found in /proc/<pid>/stat and return the sum of the 175 // Parse the data found in /proc/<pid>/stat and return the sum of the
174 // CPU-related ticks. Returns -1 on parse error. 176 // CPU-related ticks. Returns -1 on parse error.
175 // Exposed for testing. 177 // Exposed for testing.
176 BASE_EXPORT int ParseProcStatCPU(const std::string& input); 178 BASE_EXPORT int ParseProcStatCPU(const std::string& input);
177 179
178 // The maximum allowed value for the OOM score. 180 // The maximum allowed value for the OOM score.
179 const int kMaxOomScore = 1000; 181 const int kMaxOomScore = 1000;
180 182
181 // This adjusts /proc/<pid>/oom_score_adj so the Linux OOM killer will 183 // This adjusts /proc/<pid>/oom_score_adj so the Linux OOM killer will
182 // prefer to kill certain process types over others. The range for the 184 // prefer to kill certain process types over others. The range for the
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 // instance running inside the parent. The parent's Breakpad instance should 776 // instance running inside the parent. The parent's Breakpad instance should
775 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler 777 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler
776 // in the child after forking will restore the standard exception handler. 778 // in the child after forking will restore the standard exception handler.
777 // See http://crbug.com/20371/ for more details. 779 // See http://crbug.com/20371/ for more details.
778 void RestoreDefaultExceptionHandler(); 780 void RestoreDefaultExceptionHandler();
779 #endif // defined(OS_MACOSX) 781 #endif // defined(OS_MACOSX)
780 782
781 } // namespace base 783 } // namespace base
782 784
783 #endif // BASE_PROCESS_UTIL_H_ 785 #endif // BASE_PROCESS_UTIL_H_
OLDNEW
« no previous file with comments | « base/base_paths_linux.cc ('k') | base/process_util_openbsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698