| Index: base/mac/launchd.cc
|
| diff --git a/chrome/browser/mac/launchd.cc b/base/mac/launchd.cc
|
| similarity index 86%
|
| rename from chrome/browser/mac/launchd.cc
|
| rename to base/mac/launchd.cc
|
| index 3a55c3b688b0f82f27dbe04d7a7624807f7d8918..1d384c93a2724cb61a30106ab606de0be08763d3 100644
|
| --- a/chrome/browser/mac/launchd.cc
|
| +++ b/base/mac/launchd.cc
|
| @@ -1,17 +1,14 @@
|
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| // 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;
|
|
|
| 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
|
|
|