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 "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/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 59 } |
60 | 60 |
61 | 61 |
62 | 62 |
63 bool CheckServiceProcessReady() { | 63 bool CheckServiceProcessReady() { |
64 scoped_ptr<MultiProcessLock> running_lock(TakeServiceRunningLock(false)); | 64 scoped_ptr<MultiProcessLock> running_lock(TakeServiceRunningLock(false)); |
65 return running_lock.get() == NULL; | 65 return running_lock.get() == NULL; |
66 } | 66 } |
67 | 67 |
68 bool ServiceProcessState::TakeSingletonLock() { | 68 bool ServiceProcessState::TakeSingletonLock() { |
69 state_->initializing_lock_.reset(TakeServiceInitializingLock(true)); | 69 state_->initializing_lock.reset(TakeServiceInitializingLock(true)); |
70 return state_->initializing_lock_.get(); | 70 return state_->initializing_lock.get(); |
71 } | 71 } |
72 | 72 |
73 bool ServiceProcessState::AddToAutoRun() { | 73 bool ServiceProcessState::AddToAutoRun() { |
74 DCHECK(autorun_command_line_.get()); | 74 DCHECK(autorun_command_line_.get()); |
75 #if defined(GOOGLE_CHROME_BUILD) | 75 #if defined(GOOGLE_CHROME_BUILD) |
76 std::string app_name = "Google Chrome Service"; | 76 std::string app_name = "Google Chrome Service"; |
77 #else // CHROMIUM_BUILD | 77 #else // CHROMIUM_BUILD |
78 std::string app_name = "Chromium Service"; | 78 std::string app_name = "Chromium Service"; |
79 #endif | 79 #endif |
80 return AutoStart::AddApplication( | 80 return AutoStart::AddApplication( |
81 GetServiceProcessScopedName(GetBaseDesktopName()), | 81 GetServiceProcessScopedName(GetBaseDesktopName()), |
82 app_name, | 82 app_name, |
83 autorun_command_line_->GetCommandLineString(), | 83 autorun_command_line_->GetCommandLineString(), |
84 false); | 84 false); |
85 } | 85 } |
86 | 86 |
87 bool ServiceProcessState::RemoveFromAutoRun() { | 87 bool ServiceProcessState::RemoveFromAutoRun() { |
88 return AutoStart::Remove( | 88 return AutoStart::Remove( |
89 GetServiceProcessScopedName(GetBaseDesktopName())); | 89 GetServiceProcessScopedName(GetBaseDesktopName())); |
90 } | 90 } |
OLD | NEW |