OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/common/mac/launchd.h" | 5 #include "chrome/common/mac/launchd.h" |
6 | 6 |
7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
8 #include <launch.h> | 8 #include <launch.h> |
9 | 9 |
10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 void Launchd::SetInstance(Launchd* instance) { | 81 void Launchd::SetInstance(Launchd* instance) { |
82 if (instance) { | 82 if (instance) { |
83 CHECK(!g_instance_); | 83 CHECK(!g_instance_); |
84 } | 84 } |
85 g_instance_ = instance; | 85 g_instance_ = instance; |
86 } | 86 } |
87 | 87 |
88 Launchd::~Launchd() { } | 88 Launchd::~Launchd() { } |
89 | 89 |
90 CFDictionaryRef Launchd::CopyExports() { | |
91 return GTMCopyLaunchdExports(); | |
92 } | |
93 | |
94 CFDictionaryRef Launchd::CopyJobDictionary(CFStringRef label) { | 90 CFDictionaryRef Launchd::CopyJobDictionary(CFStringRef label) { |
95 return GTMSMJobCopyDictionary(label); | 91 return GTMSMJobCopyDictionary(label); |
96 } | 92 } |
97 | 93 |
98 CFDictionaryRef Launchd::CopyDictionaryByCheckingIn(CFErrorRef* error) { | 94 CFDictionaryRef Launchd::CopyDictionaryByCheckingIn(CFErrorRef* error) { |
99 return GTMSMCopyJobCheckInDictionary(error); | 95 return GTMSMCopyJobCheckInDictionary(error); |
100 } | 96 } |
101 | 97 |
102 bool Launchd::RemoveJob(CFStringRef label, CFErrorRef* error) { | 98 bool Launchd::RemoveJob(CFStringRef label, CFErrorRef* error) { |
103 return GTMSMJobRemove(label, error); | 99 return GTMSMJobRemove(label, error); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 NSError* err = nil; | 156 NSError* err = nil; |
161 if (![[NSFileManager defaultManager] removeItemAtPath:[ns_url path] | 157 if (![[NSFileManager defaultManager] removeItemAtPath:[ns_url path] |
162 error:&err]) { | 158 error:&err]) { |
163 if ([err code] != NSFileNoSuchFileError) { | 159 if ([err code] != NSFileNoSuchFileError) { |
164 DLOG(ERROR) << "DeletePlist: " << base::mac::NSToCFCast(err); | 160 DLOG(ERROR) << "DeletePlist: " << base::mac::NSToCFCast(err); |
165 } | 161 } |
166 return false; | 162 return false; |
167 } | 163 } |
168 return true; | 164 return true; |
169 } | 165 } |
OLD | NEW |