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 // This file implements the Windows service controlling Me2Me host processes | 5 // This file implements the Windows service controlling Me2Me host processes |
6 // running within user sessions. | 6 // running within user sessions. |
7 | 7 |
8 #include "remoting/host/win/host_service.h" | 8 #include "remoting/host/win/host_service.h" |
9 | 9 |
10 #include <sddl.h> | 10 #include <sddl.h> |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 | 213 |
214 daemon_process_ = DaemonProcess::Create( | 214 daemon_process_ = DaemonProcess::Create( |
215 task_runner, | 215 task_runner, |
216 io_task_runner, | 216 io_task_runner, |
217 base::Bind(&HostService::StopDaemonProcess, weak_ptr_)); | 217 base::Bind(&HostService::StopDaemonProcess, weak_ptr_)); |
218 } | 218 } |
219 | 219 |
220 int HostService::RunAsService() { | 220 int HostService::RunAsService() { |
221 SERVICE_TABLE_ENTRYW dispatch_table[] = { | 221 SERVICE_TABLE_ENTRYW dispatch_table[] = { |
222 { const_cast<LPWSTR>(kWindowsServiceName), &HostService::ServiceMain }, | 222 { const_cast<LPWSTR>(kWindowsServiceName), &HostService::ServiceMain }, |
223 { NULL, NULL } | 223 { nullptr, nullptr } |
224 }; | 224 }; |
225 | 225 |
226 if (!StartServiceCtrlDispatcherW(dispatch_table)) { | 226 if (!StartServiceCtrlDispatcherW(dispatch_table)) { |
227 PLOG(ERROR) << "Failed to connect to the service control manager"; | 227 PLOG(ERROR) << "Failed to connect to the service control manager"; |
228 return kInitializationFailed; | 228 return kInitializationFailed; |
229 } | 229 } |
230 | 230 |
231 // Wait until the service thread completely exited to avoid concurrent | 231 // Wait until the service thread completely exited to avoid concurrent |
232 // teardown of objects registered with base::AtExitManager and object | 232 // teardown of objects registered with base::AtExitManager and object |
233 // destoyed by the service thread. | 233 // destoyed by the service thread. |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 int DaemonProcessMain() { | 434 int DaemonProcessMain() { |
435 HostService* service = HostService::GetInstance(); | 435 HostService* service = HostService::GetInstance(); |
436 if (!service->InitWithCommandLine(base::CommandLine::ForCurrentProcess())) { | 436 if (!service->InitWithCommandLine(base::CommandLine::ForCurrentProcess())) { |
437 return kUsageExitCode; | 437 return kUsageExitCode; |
438 } | 438 } |
439 | 439 |
440 return service->Run(); | 440 return service->Run(); |
441 } | 441 } |
442 | 442 |
443 } // namespace remoting | 443 } // namespace remoting |
OLD | NEW |