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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } | 66 } |
67 | 67 |
68 private: | 68 private: |
69 base::win::ScopedHandle shutdown_event_; | 69 base::win::ScopedHandle shutdown_event_; |
70 base::win::ObjectWatcher watcher_; | 70 base::win::ObjectWatcher watcher_; |
71 scoped_ptr<Task> shutdown_task_; | 71 scoped_ptr<Task> shutdown_task_; |
72 }; | 72 }; |
73 | 73 |
74 } // namespace | 74 } // namespace |
75 | 75 |
| 76 // Gets the name of the service process IPC channel. |
| 77 IPC::ChannelHandle GetServiceProcessChannel() { |
| 78 return GetServiceProcessScopedVersionedName("_service_ipc"); |
| 79 } |
| 80 |
76 bool ForceServiceProcessShutdown(const std::string& version, | 81 bool ForceServiceProcessShutdown(const std::string& version, |
77 base::ProcessId process_id) { | 82 base::ProcessId process_id) { |
78 base::win::ScopedHandle shutdown_event; | 83 base::win::ScopedHandle shutdown_event; |
79 std::string versioned_name = version; | 84 std::string versioned_name = version; |
80 versioned_name.append("_service_shutdown_evt"); | 85 versioned_name.append("_service_shutdown_evt"); |
81 string16 event_name = | 86 string16 event_name = |
82 UTF8ToWide(GetServiceProcessScopedName(versioned_name)); | 87 UTF8ToWide(GetServiceProcessScopedName(versioned_name)); |
83 shutdown_event.Set(OpenEvent(EVENT_MODIFY_STATE, FALSE, event_name.c_str())); | 88 shutdown_event.Set(OpenEvent(EVENT_MODIFY_STATE, FALSE, event_name.c_str())); |
84 if (!shutdown_event.IsValid()) | 89 if (!shutdown_event.IsValid()) |
85 return false; | 90 return false; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 base::win::RemoveCommandFromAutoRun( | 162 base::win::RemoveCommandFromAutoRun( |
158 HKEY_CURRENT_USER, UTF8ToWide(GetObsoleteServiceProcessAutoRunKey())); | 163 HKEY_CURRENT_USER, UTF8ToWide(GetObsoleteServiceProcessAutoRunKey())); |
159 return base::win::RemoveCommandFromAutoRun( | 164 return base::win::RemoveCommandFromAutoRun( |
160 HKEY_CURRENT_USER, UTF8ToWide(GetServiceProcessAutoRunKey())); | 165 HKEY_CURRENT_USER, UTF8ToWide(GetServiceProcessAutoRunKey())); |
161 } | 166 } |
162 | 167 |
163 void ServiceProcessState::TearDownState() { | 168 void ServiceProcessState::TearDownState() { |
164 delete state_; | 169 delete state_; |
165 state_ = NULL; | 170 state_ = NULL; |
166 } | 171 } |
OLD | NEW |