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 <windows.h> | 10 #include <windows.h> |
11 #include <shellapi.h> | 11 #include <shellapi.h> |
12 #include <wtsapi32.h> | 12 #include <wtsapi32.h> |
13 | 13 |
14 #include "base/at_exit.h" | 14 #include "base/at_exit.h" |
15 #include "base/base_paths.h" | 15 #include "base/base_paths.h" |
16 #include "base/base_switches.h" | 16 #include "base/base_switches.h" |
17 #include "base/bind.h" | 17 #include "base/bind.h" |
18 #include "base/command_line.h" | 18 #include "base/command_line.h" |
19 #include "base/file_path.h" | 19 #include "base/file_path.h" |
20 #include "base/message_loop.h" | 20 #include "base/message_loop.h" |
21 #include "base/single_thread_task_runner.h" | |
22 #include "base/stringprintf.h" | 21 #include "base/stringprintf.h" |
23 #include "base/threading/thread.h" | 22 #include "base/threading/thread.h" |
24 #include "base/utf_string_conversions.h" | 23 #include "base/utf_string_conversions.h" |
25 #include "base/win/wrapped_window_proc.h" | 24 #include "base/win/wrapped_window_proc.h" |
26 #include "remoting/base/auto_thread_task_runner.h" | 25 #include "remoting/base/auto_thread_task_runner.h" |
27 #include "remoting/base/breakpad.h" | 26 #include "remoting/base/breakpad.h" |
28 #include "remoting/base/scoped_sc_handle_win.h" | 27 #include "remoting/base/scoped_sc_handle_win.h" |
29 #include "remoting/base/stoppable.h" | 28 #include "remoting/base/stoppable.h" |
30 #include "remoting/host/branding.h" | 29 #include "remoting/host/branding.h" |
31 #include "remoting/host/host_exit_codes.h" | 30 #include "remoting/host/host_exit_codes.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 } | 193 } |
195 | 194 |
196 return true; | 195 return true; |
197 } | 196 } |
198 | 197 |
199 int HostService::Run() { | 198 int HostService::Run() { |
200 return (this->*run_routine_)(); | 199 return (this->*run_routine_)(); |
201 } | 200 } |
202 | 201 |
203 void HostService::CreateLauncher( | 202 void HostService::CreateLauncher( |
204 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner) { | 203 scoped_refptr<AutoThreadTaskRunner> io_task_runner) { |
205 | 204 |
206 #if defined(REMOTING_MULTI_PROCESS) | 205 #if defined(REMOTING_MULTI_PROCESS) |
207 | 206 |
208 child_ = DaemonProcess::Create( | 207 child_ = DaemonProcess::Create( |
209 main_task_runner_, | 208 main_task_runner_, |
210 io_task_runner, | 209 io_task_runner, |
211 base::Bind(&HostService::OnChildStopped, | 210 base::Bind(&HostService::OnChildStopped, |
212 base::Unretained(this))).PassAs<Stoppable>(); | 211 base::Unretained(this))).PassAs<Stoppable>(); |
213 | 212 |
214 #else // !defined(REMOTING_MULTI_PROCESS) | 213 #else // !defined(REMOTING_MULTI_PROCESS) |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 } | 491 } |
493 | 492 |
494 remoting::HostService* service = remoting::HostService::GetInstance(); | 493 remoting::HostService* service = remoting::HostService::GetInstance(); |
495 if (!service->InitWithCommandLine(command_line)) { | 494 if (!service->InitWithCommandLine(command_line)) { |
496 usage(command_line->GetProgram()); | 495 usage(command_line->GetProgram()); |
497 return remoting::kUsageExitCode; | 496 return remoting::kUsageExitCode; |
498 } | 497 } |
499 | 498 |
500 return service->Run(); | 499 return service->Run(); |
501 } | 500 } |
OLD | NEW |