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

Unified Diff: chrome/browser/process_info_snapshot_mac.cc

Issue 426010: Mac: fix error message which mentions top instead of ps. (Closed)
Patch Set: Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/process_info_snapshot_mac.cc
diff --git a/chrome/browser/process_info_snapshot_mac.cc b/chrome/browser/process_info_snapshot_mac.cc
index 7e8117be6742e30171e57afb3aecb2b265da5d50..611f8f40a90f48f8c3408d35437fa2da35b75b67 100644
--- a/chrome/browser/process_info_snapshot_mac.cc
+++ b/chrome/browser/process_info_snapshot_mac.cc
@@ -25,10 +25,11 @@ ProcessInfoSnapshot::~ProcessInfoSnapshot() {
// Note: we ignore the "tsiz" (text size) display option of ps because it's
// always zero (tested on 10.5 and 10.6).
bool ProcessInfoSnapshot::Sample(std::vector<base::ProcessId> pid_list) {
+ const char* kPsPathName = "/bin/ps";
Reset();
std::vector<std::string> argv;
- argv.push_back("/bin/ps");
+ argv.push_back(kPsPathName);
// Get PID, PPID, (real) UID, effective UID, resident set size, virtual memory
// size, and command.
argv.push_back("-o");
@@ -44,7 +45,7 @@ bool ProcessInfoSnapshot::Sample(std::vector<base::ProcessId> pid_list) {
CommandLine command_line(argv);
if (!base::GetAppOutputRestricted(command_line,
&output, (pid_list.size() + 10) * 100)) {
- LOG(ERROR) << "Failure running /bin/ps to acquire data.";
+ LOG(ERROR) << "Failure running " << kPsPathName << " to acquire data.";
return false;
}
@@ -70,18 +71,18 @@ bool ProcessInfoSnapshot::Sample(std::vector<base::ProcessId> pid_list) {
in.ignore(1, ' '); // Eat the space.
std::getline(in, proc_info.command); // Get the rest of the line.
if (!in.good()) {
- LOG(ERROR) << "Error parsing output from /usr/bin/top.";
+ LOG(ERROR) << "Error parsing output from " << kPsPathName << ".";
return false;
}
// Make sure the new PID isn't already in our list.
if (proc_info_entries_.find(proc_info.pid) != proc_info_entries_.end()) {
- LOG(ERROR) << "Duplicate PID in output from /bin/ps.";
+ LOG(ERROR) << "Duplicate PID in output from " << kPsPathName << ".";
return false;
}
if (!proc_info.pid || ! proc_info.vsize) {
- LOG(WARNING) << "Invalid data from /bin/ps.";
+ LOG(WARNING) << "Invalid data from " << kPsPathName << ".";
return false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698