| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 static_cast<int>(NSNetworkDomainMask), | 66 static_cast<int>(NSNetworkDomainMask), |
| 67 "NSNetworkDomainMask value changed"); | 67 "NSNetworkDomainMask value changed"); |
| 68 static_assert(static_cast<int>(Launchd::System) == | 68 static_assert(static_cast<int>(Launchd::System) == |
| 69 static_cast<int>(NSSystemDomainMask), | 69 static_cast<int>(NSSystemDomainMask), |
| 70 "NSSystemDomainMask value changed"); | 70 "NSSystemDomainMask value changed"); |
| 71 | 71 |
| 72 Launchd* Launchd::g_instance_ = NULL; | 72 Launchd* Launchd::g_instance_ = NULL; |
| 73 | 73 |
| 74 Launchd* Launchd::GetInstance() { | 74 Launchd* Launchd::GetInstance() { |
| 75 if (!g_instance_) { | 75 if (!g_instance_) { |
| 76 g_instance_ = Singleton<Launchd>::get(); | 76 g_instance_ = base::Singleton<Launchd>::get(); |
| 77 } | 77 } |
| 78 return g_instance_; | 78 return g_instance_; |
| 79 } | 79 } |
| 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 } |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 NSError* err = nil; | 156 NSError* err = nil; |
| 157 if (![[NSFileManager defaultManager] removeItemAtPath:[ns_url path] | 157 if (![[NSFileManager defaultManager] removeItemAtPath:[ns_url path] |
| 158 error:&err]) { | 158 error:&err]) { |
| 159 if ([err code] != NSFileNoSuchFileError) { | 159 if ([err code] != NSFileNoSuchFileError) { |
| 160 DLOG(ERROR) << "DeletePlist: " << base::mac::NSToCFCast(err); | 160 DLOG(ERROR) << "DeletePlist: " << base::mac::NSToCFCast(err); |
| 161 } | 161 } |
| 162 return false; | 162 return false; |
| 163 } | 163 } |
| 164 return true; | 164 return true; |
| 165 } | 165 } |
| OLD | NEW |