| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef BASE_MAC_LAUNCHD_H_ | 5 #ifndef BASE_MAC_LAUNCHD_H_ |
| 6 #define BASE_MAC_LAUNCHD_H_ | 6 #define BASE_MAC_LAUNCHD_H_ |
| 7 #pragma once | |
| 8 | 7 |
| 9 #include <launch.h> | 8 #include <launch.h> |
| 10 #include <sys/types.h> | 9 #include <sys/types.h> |
| 11 | 10 |
| 12 #include <string> | 11 #include <string> |
| 13 | 12 |
| 14 #include "base/base_export.h" | 13 #include "base/base_export.h" |
| 15 | 14 |
| 16 namespace base { | 15 namespace base { |
| 17 namespace mac { | 16 namespace mac { |
| 18 | 17 |
| 19 // MessageForJob sends a single message to launchd with a simple dictionary | 18 // MessageForJob sends a single message to launchd with a simple dictionary |
| 20 // mapping |operation| to |job_label|, and returns the result of calling | 19 // mapping |operation| to |job_label|, and returns the result of calling |
| 21 // launch_msg to send that message. On failure, returns NULL. The caller | 20 // launch_msg to send that message. On failure, returns NULL. The caller |
| 22 // assumes ownership of the returned launch_data_t object. | 21 // assumes ownership of the returned launch_data_t object. |
| 23 BASE_EXPORT | 22 BASE_EXPORT |
| 24 launch_data_t MessageForJob(const std::string& job_label, | 23 launch_data_t MessageForJob(const std::string& job_label, |
| 25 const char* operation); | 24 const char* operation); |
| 26 | 25 |
| 27 // Returns the process ID for |job_label| if the job is running, 0 if the job | 26 // Returns the process ID for |job_label| if the job is running, 0 if the job |
| 28 // is loaded but not running, or -1 on error. | 27 // is loaded but not running, or -1 on error. |
| 29 BASE_EXPORT | 28 BASE_EXPORT |
| 30 pid_t PIDForJob(const std::string& job_label); | 29 pid_t PIDForJob(const std::string& job_label); |
| 31 | 30 |
| 32 } // namespace mac | 31 } // namespace mac |
| 33 } // namespace base | 32 } // namespace base |
| 34 | 33 |
| 35 #endif // BASE_MAC_LAUNCHD_H_ | 34 #endif // BASE_MAC_LAUNCHD_H_ |
| OLD | NEW |