| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/service_process_util_posix.h" | 5 #include "chrome/common/service_process_util_posix.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <unistd.h> | 8 #include <unistd.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 bool CheckServiceProcessReady() { | 70 bool CheckServiceProcessReady() { |
| 71 scoped_ptr<MultiProcessLock> running_lock(TakeServiceRunningLock(false)); | 71 scoped_ptr<MultiProcessLock> running_lock(TakeServiceRunningLock(false)); |
| 72 return running_lock.get() == NULL; | 72 return running_lock.get() == NULL; |
| 73 } | 73 } |
| 74 | 74 |
| 75 bool ServiceProcessState::TakeSingletonLock() { | 75 bool ServiceProcessState::TakeSingletonLock() { |
| 76 state_->initializing_lock_.reset(TakeServiceInitializingLock(true)); | 76 state_->initializing_lock_.reset(TakeServiceInitializingLock(true)); |
| 77 return state_->initializing_lock_.get(); | 77 return state_->initializing_lock_.get(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool ServiceProcessState::SignalReadyPlatformSpecific() { |
| 81 state_->running_lock_.reset(TakeServiceRunningLock(true)); |
| 82 if (state_->running_lock_.get() == NULL) { |
| 83 return false; |
| 84 } |
| 85 return true; |
| 86 } |
| 87 |
| 80 bool ServiceProcessState::AddToAutoRun() { | 88 bool ServiceProcessState::AddToAutoRun() { |
| 81 DCHECK(autorun_command_line_.get()); | 89 DCHECK(autorun_command_line_.get()); |
| 82 #if defined(GOOGLE_CHROME_BUILD) | 90 #if defined(GOOGLE_CHROME_BUILD) |
| 83 std::string app_name = "Google Chrome Service"; | 91 std::string app_name = "Google Chrome Service"; |
| 84 #else // CHROMIUM_BUILD | 92 #else // CHROMIUM_BUILD |
| 85 std::string app_name = "Chromium Service"; | 93 std::string app_name = "Chromium Service"; |
| 86 #endif | 94 #endif |
| 87 return AutoStart::AddApplication( | 95 return AutoStart::AddApplication( |
| 88 GetServiceProcessScopedName(GetBaseDesktopName()), | 96 GetServiceProcessScopedName(GetBaseDesktopName()), |
| 89 app_name, | 97 app_name, |
| 90 autorun_command_line_->command_line_string(), | 98 autorun_command_line_->command_line_string(), |
| 91 false); | 99 false); |
| 92 } | 100 } |
| 93 | 101 |
| 94 bool ServiceProcessState::RemoveFromAutoRun() { | 102 bool ServiceProcessState::RemoveFromAutoRun() { |
| 95 return AutoStart::Remove( | 103 return AutoStart::Remove( |
| 96 GetServiceProcessScopedName(GetBaseDesktopName())); | 104 GetServiceProcessScopedName(GetBaseDesktopName())); |
| 97 } | 105 } |
| OLD | NEW |