| 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.h" | 5 #include "chrome/common/service_process_util.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 base::win::ScopedHandle terminate_event_; | 75 base::win::ScopedHandle terminate_event_; |
| 76 base::win::ObjectWatcher watcher_; | 76 base::win::ObjectWatcher watcher_; |
| 77 base::Closure terminate_task_; | 77 base::Closure terminate_task_; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace | 80 } // namespace |
| 81 | 81 |
| 82 // Gets the name of the service process IPC channel. | 82 // Gets the name of the service process IPC channel. |
| 83 IPC::ChannelHandle GetServiceProcessChannel() { | 83 mojo::edk::NamedPlatformHandle GetServiceProcessChannel() { |
| 84 return GetServiceProcessScopedVersionedName("_service_ipc"); | 84 return mojo::edk::NamedPlatformHandle( |
| 85 GetServiceProcessScopedVersionedName("_service_ipc")); |
| 85 } | 86 } |
| 86 | 87 |
| 87 bool ForceServiceProcessShutdown(const std::string& version, | 88 bool ForceServiceProcessShutdown(const std::string& version, |
| 88 base::ProcessId process_id) { | 89 base::ProcessId process_id) { |
| 89 base::win::ScopedHandle terminate_event; | 90 base::win::ScopedHandle terminate_event; |
| 90 std::string versioned_name = version; | 91 std::string versioned_name = version; |
| 91 versioned_name.append(kTerminateEventSuffix); | 92 versioned_name.append(kTerminateEventSuffix); |
| 92 base::string16 event_name = | 93 base::string16 event_name = |
| 93 base::UTF8ToWide(GetServiceProcessScopedName(versioned_name)); | 94 base::UTF8ToWide(GetServiceProcessScopedName(versioned_name)); |
| 94 terminate_event.Set(OpenEvent(EVENT_MODIFY_STATE, FALSE, event_name.c_str())); | 95 terminate_event.Set(OpenEvent(EVENT_MODIFY_STATE, FALSE, event_name.c_str())); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 HKEY_CURRENT_USER, | 170 HKEY_CURRENT_USER, |
| 170 base::UTF8ToWide(GetObsoleteServiceProcessAutoRunKey())); | 171 base::UTF8ToWide(GetObsoleteServiceProcessAutoRunKey())); |
| 171 return base::win::RemoveCommandFromAutoRun( | 172 return base::win::RemoveCommandFromAutoRun( |
| 172 HKEY_CURRENT_USER, base::UTF8ToWide(GetServiceProcessAutoRunKey())); | 173 HKEY_CURRENT_USER, base::UTF8ToWide(GetServiceProcessAutoRunKey())); |
| 173 } | 174 } |
| 174 | 175 |
| 175 void ServiceProcessState::TearDownState() { | 176 void ServiceProcessState::TearDownState() { |
| 176 delete state_; | 177 delete state_; |
| 177 state_ = NULL; | 178 state_ = NULL; |
| 178 } | 179 } |
| OLD | NEW |