Index: base/mac/launchd.cc |
diff --git a/chrome/browser/mac/launchd.cc b/base/mac/launchd.cc |
similarity index 89% |
rename from chrome/browser/mac/launchd.cc |
rename to base/mac/launchd.cc |
index 3a55c3b688b0f82f27dbe04d7a7624807f7d8918..a2691055239f661f5aa2892367656ad61276ef81 100644 |
--- a/chrome/browser/mac/launchd.cc |
+++ b/base/mac/launchd.cc |
@@ -2,16 +2,13 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "chrome/browser/mac/launchd.h" |
- |
-#include <launch.h> |
+#include "base/mac/launchd.h" |
#include "base/logging.h" |
-#include "chrome/browser/mac/scoped_launch_data.h" |
- |
-namespace launchd { |
+#include "base/mac/scoped_launch_data.h" |
-namespace { |
+namespace base { |
+namespace mac { |
// MessageForJob sends a single message to launchd with a simple dictionary |
// mapping |operation| to |job_label|, and returns the result of calling |
@@ -45,8 +42,6 @@ launch_data_t MessageForJob(const std::string& job_label, |
return launch_msg(message); |
} |
-} // namespace |
- |
pid_t PIDForJob(const std::string& job_label) { |
ScopedLaunchData response(MessageForJob(job_label, LAUNCH_KEY_GETJOB)); |
if (!response) { |
@@ -65,10 +60,8 @@ pid_t PIDForJob(const std::string& job_label) { |
launch_data_t pid_data = launch_data_dict_lookup(response, |
LAUNCH_JOBKEY_PID); |
- if (!pid_data) { |
- LOG(ERROR) << "PIDForJob: no pid"; |
- return -1; |
- } |
+ if (!pid_data) |
+ return 0; |
Mark Mentovai
2012/03/28 16:37:50
Why have you changed this? Now it doesn’t even mat
|
if (launch_data_get_type(pid_data) != LAUNCH_DATA_INTEGER) { |
LOG(ERROR) << "PIDForJob: expected integer"; |
@@ -78,4 +71,5 @@ pid_t PIDForJob(const std::string& job_label) { |
return launch_data_get_integer(pid_data); |
} |
-} // namespace launchd |
+} // namespace mac |
+} // namespace base |