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

Unified Diff: base/process/process_handle_mac.cc

Issue 218883008: Use process_singleton_linux on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CreateUniqueTempDir is fine. DCHECK socket path length. Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: base/process/process_handle_mac.cc
diff --git a/base/process/process_handle_mac.cc b/base/process/process_handle_mac.cc
index 6cb8d686e4d77c1a605e6d18b5f0613fb398da90..cbf0bc5c4393fb9d3e0100e21ec3514ac504657b 100644
--- a/base/process/process_handle_mac.cc
+++ b/base/process/process_handle_mac.cc
@@ -4,6 +4,7 @@
#include "base/process/process_handle.h"
+#include <libproc.h>
#include <sys/sysctl.h>
#include <sys/types.h>
@@ -24,4 +25,12 @@ ProcessId GetParentProcessId(ProcessHandle process) {
return info.kp_eproc.e_ppid;
}
+FilePath GetProcessExecutablePath(ProcessHandle process) {
+ char pathbuf[PROC_PIDPATHINFO_MAXSIZE];
+ if (!proc_pidpath(process, pathbuf, sizeof(pathbuf)))
+ return FilePath();
+
+ return FilePath(pathbuf);
+}
+
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698