| 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/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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 MultiProcessLock* TakeServiceRunningLock(bool waiting) { | 57 MultiProcessLock* TakeServiceRunningLock(bool waiting) { |
| 58 std::string lock_name = | 58 std::string lock_name = |
| 59 GetServiceProcessScopedName("_service_running"); | 59 GetServiceProcessScopedName("_service_running"); |
| 60 return TakeNamedLock(lock_name, waiting); | 60 return TakeNamedLock(lock_name, waiting); |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool ForceServiceProcessShutdown(const std::string& version, | 63 bool ForceServiceProcessShutdown(const std::string& version, |
| 64 base::ProcessId process_id) { | 64 base::ProcessId process_id) { |
| 65 if (kill(process_id, SIGTERM) < 0) { | 65 if (kill(process_id, SIGTERM) < 0) { |
| 66 PLOG(ERROR) << "kill"; | 66 DPLOG(ERROR) << "kill"; |
| 67 return false; | 67 return false; |
| 68 } | 68 } |
| 69 return true; | 69 return true; |
| 70 } | 70 } |
| 71 | 71 |
| 72 // Gets the name of the service process IPC channel. | 72 // Gets the name of the service process IPC channel. |
| 73 // Returns an absolute path as required. | 73 // Returns an absolute path as required. |
| 74 IPC::ChannelHandle GetServiceProcessChannel() { | 74 IPC::ChannelHandle GetServiceProcessChannel() { |
| 75 FilePath temp_dir; | 75 FilePath temp_dir; |
| 76 PathService::Get(base::DIR_TEMP, &temp_dir); | 76 PathService::Get(base::DIR_TEMP, &temp_dir); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 102 GetServiceProcessScopedName(GetBaseDesktopName()), | 102 GetServiceProcessScopedName(GetBaseDesktopName()), |
| 103 app_name, | 103 app_name, |
| 104 autorun_command_line_->GetCommandLineString(), | 104 autorun_command_line_->GetCommandLineString(), |
| 105 false); | 105 false); |
| 106 } | 106 } |
| 107 | 107 |
| 108 bool ServiceProcessState::RemoveFromAutoRun() { | 108 bool ServiceProcessState::RemoveFromAutoRun() { |
| 109 return AutoStart::Remove( | 109 return AutoStart::Remove( |
| 110 GetServiceProcessScopedName(GetBaseDesktopName())); | 110 GetServiceProcessScopedName(GetBaseDesktopName())); |
| 111 } | 111 } |
| OLD | NEW |