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 <signal.h> | 5 #include <signal.h> |
6 #include <unistd.h> | 6 #include <unistd.h> |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 base::ProcessId process_id) { | 44 base::ProcessId process_id) { |
45 if (kill(process_id, SIGTERM) < 0) { | 45 if (kill(process_id, SIGTERM) < 0) { |
46 DPLOG(ERROR) << "kill"; | 46 DPLOG(ERROR) << "kill"; |
47 return false; | 47 return false; |
48 } | 48 } |
49 return true; | 49 return true; |
50 } | 50 } |
51 | 51 |
52 // Gets the name of the service process IPC channel. | 52 // Gets the name of the service process IPC channel. |
53 // Returns an absolute path as required. | 53 // Returns an absolute path as required. |
54 IPC::ChannelHandle GetServiceProcessChannel() { | 54 mojo::edk::NamedPlatformHandle GetServiceProcessChannel() { |
55 base::FilePath temp_dir; | 55 base::FilePath temp_dir; |
56 PathService::Get(base::DIR_TEMP, &temp_dir); | 56 PathService::Get(base::DIR_TEMP, &temp_dir); |
57 std::string pipe_name = GetServiceProcessScopedVersionedName("_service_ipc"); | 57 std::string pipe_name = GetServiceProcessScopedVersionedName("_service_ipc"); |
58 std::string pipe_path = temp_dir.Append(pipe_name).value(); | 58 std::string pipe_path = temp_dir.Append(pipe_name).value(); |
59 return pipe_path; | 59 return mojo::edk::NamedPlatformHandle(pipe_path); |
60 } | 60 } |
61 | 61 |
62 | 62 |
63 | 63 |
64 bool CheckServiceProcessReady() { | 64 bool CheckServiceProcessReady() { |
65 std::unique_ptr<MultiProcessLock> running_lock(TakeServiceRunningLock(false)); | 65 std::unique_ptr<MultiProcessLock> running_lock(TakeServiceRunningLock(false)); |
66 return running_lock.get() == NULL; | 66 return running_lock.get() == NULL; |
67 } | 67 } |
68 | 68 |
69 bool ServiceProcessState::TakeSingletonLock() { | 69 bool ServiceProcessState::TakeSingletonLock() { |
(...skipping 12 matching lines...) Expand all Loading... |
82 GetServiceProcessScopedName(GetBaseDesktopName()), | 82 GetServiceProcessScopedName(GetBaseDesktopName()), |
83 app_name, | 83 app_name, |
84 autorun_command_line_->GetCommandLineString(), | 84 autorun_command_line_->GetCommandLineString(), |
85 false); | 85 false); |
86 } | 86 } |
87 | 87 |
88 bool ServiceProcessState::RemoveFromAutoRun() { | 88 bool ServiceProcessState::RemoveFromAutoRun() { |
89 return AutoStart::Remove( | 89 return AutoStart::Remove( |
90 GetServiceProcessScopedName(GetBaseDesktopName())); | 90 GetServiceProcessScopedName(GetBaseDesktopName())); |
91 } | 91 } |
OLD | NEW |