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

Unified Diff: util/mac/service_management.cc

Issue 1565873002: Update mini_chromium to a43fee120b10ed71df4e55a370948ca461d78232 (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « util/mac/launchd_test.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mac/service_management.cc
diff --git a/util/mac/service_management.cc b/util/mac/service_management.cc
index 9940006ade7cfef3558eddb3f35a5b2340690a0c..e1d45f3ce6644f316dcb3d69d5e4d8409529cd34 100644
--- a/util/mac/service_management.cc
+++ b/util/mac/service_management.cc
@@ -28,10 +28,10 @@ namespace {
launch_data_t LaunchDataDictionaryForJob(const std::string& label) {
base::mac::ScopedLaunchData request(LaunchDataAlloc(LAUNCH_DATA_DICTIONARY));
LaunchDataDictInsert(
- request, LaunchDataNewString(label.c_str()), LAUNCH_KEY_GETJOB);
+ request.get(), LaunchDataNewString(label.c_str()), LAUNCH_KEY_GETJOB);
- base::mac::ScopedLaunchData response(LaunchMsg(request));
- if (LaunchDataGetType(response) != LAUNCH_DATA_DICTIONARY) {
+ base::mac::ScopedLaunchData response(LaunchMsg(request.get()));
+ if (LaunchDataGetType(response.get()) != LAUNCH_DATA_DICTIONARY) {
return nullptr;
}
@@ -47,21 +47,21 @@ bool ServiceManagementSubmitJob(CFDictionaryRef job_cf) {
}
base::mac::ScopedLaunchData jobs(LaunchDataAlloc(LAUNCH_DATA_ARRAY));
- LaunchDataArraySetIndex(jobs, job_launch.release(), 0);
+ LaunchDataArraySetIndex(jobs.get(), job_launch.release(), 0);
base::mac::ScopedLaunchData request(LaunchDataAlloc(LAUNCH_DATA_DICTIONARY));
- LaunchDataDictInsert(request, jobs.release(), LAUNCH_KEY_SUBMITJOB);
+ LaunchDataDictInsert(request.get(), jobs.release(), LAUNCH_KEY_SUBMITJOB);
- base::mac::ScopedLaunchData response(LaunchMsg(request));
- if (LaunchDataGetType(response) != LAUNCH_DATA_ARRAY) {
+ base::mac::ScopedLaunchData response(LaunchMsg(request.get()));
+ if (LaunchDataGetType(response.get()) != LAUNCH_DATA_ARRAY) {
return false;
}
- if (LaunchDataArrayGetCount(response) != 1) {
+ if (LaunchDataArrayGetCount(response.get()) != 1) {
return false;
}
- launch_data_t response_element = LaunchDataArrayGetIndex(response, 0);
+ launch_data_t response_element = LaunchDataArrayGetIndex(response.get(), 0);
if (LaunchDataGetType(response_element) != LAUNCH_DATA_ERRNO) {
return false;
}
@@ -77,14 +77,14 @@ bool ServiceManagementSubmitJob(CFDictionaryRef job_cf) {
bool ServiceManagementRemoveJob(const std::string& label, bool wait) {
base::mac::ScopedLaunchData request(LaunchDataAlloc(LAUNCH_DATA_DICTIONARY));
LaunchDataDictInsert(
- request, LaunchDataNewString(label.c_str()), LAUNCH_KEY_REMOVEJOB);
+ request.get(), LaunchDataNewString(label.c_str()), LAUNCH_KEY_REMOVEJOB);
- base::mac::ScopedLaunchData response(LaunchMsg(request));
- if (LaunchDataGetType(response) != LAUNCH_DATA_ERRNO) {
+ base::mac::ScopedLaunchData response(LaunchMsg(request.get()));
+ if (LaunchDataGetType(response.get()) != LAUNCH_DATA_ERRNO) {
return false;
}
- int err = LaunchDataGetErrno(response);
+ int err = LaunchDataGetErrno(response.get());
if (err == EINPROGRESS) {
if (wait) {
// TODO(mark): Use a kqueue to wait for the process to exit. To avoid a
@@ -108,7 +108,7 @@ bool ServiceManagementRemoveJob(const std::string& label, bool wait) {
bool ServiceManagementIsJobLoaded(const std::string& label) {
base::mac::ScopedLaunchData dictionary(LaunchDataDictionaryForJob(label));
- if (!dictionary) {
+ if (!dictionary.is_valid()) {
return false;
}
@@ -117,11 +117,11 @@ bool ServiceManagementIsJobLoaded(const std::string& label) {
pid_t ServiceManagementIsJobRunning(const std::string& label) {
base::mac::ScopedLaunchData dictionary(LaunchDataDictionaryForJob(label));
- if (!dictionary) {
+ if (!dictionary.is_valid()) {
return 0;
}
- launch_data_t pid = LaunchDataDictLookup(dictionary, LAUNCH_JOBKEY_PID);
+ launch_data_t pid = LaunchDataDictLookup(dictionary.get(), LAUNCH_JOBKEY_PID);
if (!pid) {
return 0;
}
« no previous file with comments | « util/mac/launchd_test.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698