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 #include "remoting/host/plugin/daemon_controller.h" | 5 #include "remoting/host/plugin/daemon_controller.h" |
6 | 6 |
7 #include <launch.h> | 7 #include <launch.h> |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 | 10 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 CFSTR(UPDATE_SUCCEEDED_NOTIFICATION_NAME), | 101 CFSTR(UPDATE_SUCCEEDED_NOTIFICATION_NAME), |
102 NULL); | 102 NULL); |
103 CFNotificationCenterRemoveObserver( | 103 CFNotificationCenterRemoveObserver( |
104 CFNotificationCenterGetDistributedCenter(), | 104 CFNotificationCenterGetDistributedCenter(), |
105 this, | 105 this, |
106 CFSTR(UPDATE_FAILED_NOTIFICATION_NAME), | 106 CFSTR(UPDATE_FAILED_NOTIFICATION_NAME), |
107 NULL); | 107 NULL); |
108 } | 108 } |
109 | 109 |
110 DaemonController::State DaemonControllerMac::GetState() { | 110 DaemonController::State DaemonControllerMac::GetState() { |
111 if (!base::mac::IsOSSnowLeopardOrLater()) { | |
112 return DaemonController::STATE_NOT_IMPLEMENTED; | |
113 } | |
114 pid_t job_pid = base::mac::PIDForJob(kServiceName); | 111 pid_t job_pid = base::mac::PIDForJob(kServiceName); |
115 if (job_pid < 0) { | 112 if (job_pid < 0) { |
116 return DaemonController::STATE_NOT_INSTALLED; | 113 return DaemonController::STATE_NOT_INSTALLED; |
117 } else if (job_pid == 0) { | 114 } else if (job_pid == 0) { |
118 // Service is stopped, or a start attempt failed. | 115 // Service is stopped, or a start attempt failed. |
119 return DaemonController::STATE_STOPPED; | 116 return DaemonController::STATE_STOPPED; |
120 } else { | 117 } else { |
121 return DaemonController::STATE_STARTED; | 118 return DaemonController::STATE_STARTED; |
122 } | 119 } |
123 } | 120 } |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 } | 364 } |
368 } | 365 } |
369 | 366 |
370 } // namespace | 367 } // namespace |
371 | 368 |
372 scoped_ptr<DaemonController> remoting::DaemonController::Create() { | 369 scoped_ptr<DaemonController> remoting::DaemonController::Create() { |
373 return scoped_ptr<DaemonController>(new DaemonControllerMac()); | 370 return scoped_ptr<DaemonController>(new DaemonControllerMac()); |
374 } | 371 } |
375 | 372 |
376 } // namespace remoting | 373 } // namespace remoting |
OLD | NEW |