| 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 <utility> |
| 9 |
| 8 #include "base/bind.h" | 10 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 11 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 13 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
| 14 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 15 #include "remoting/base/auto_thread.h" | 17 #include "remoting/base/auto_thread.h" |
| 16 #include "remoting/base/auto_thread_task_runner.h" | 18 #include "remoting/base/auto_thread_task_runner.h" |
| 17 #include "remoting/host/desktop_process.h" | 19 #include "remoting/host/desktop_process.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 ui_task_runner, | 59 ui_task_runner, |
| 58 base::Bind(&DesktopProcess::InjectSas, | 60 base::Bind(&DesktopProcess::InjectSas, |
| 59 desktop_process.AsWeakPtr()))); | 61 desktop_process.AsWeakPtr()))); |
| 60 #else // !defined(OS_WIN) | 62 #else // !defined(OS_WIN) |
| 61 desktop_environment_factory.reset(new Me2MeDesktopEnvironmentFactory( | 63 desktop_environment_factory.reset(new Me2MeDesktopEnvironmentFactory( |
| 62 ui_task_runner, | 64 ui_task_runner, |
| 63 input_task_runner, | 65 input_task_runner, |
| 64 ui_task_runner)); | 66 ui_task_runner)); |
| 65 #endif // !defined(OS_WIN) | 67 #endif // !defined(OS_WIN) |
| 66 | 68 |
| 67 if (!desktop_process.Start(desktop_environment_factory.Pass())) | 69 if (!desktop_process.Start(std::move(desktop_environment_factory))) |
| 68 return kInitializationFailed; | 70 return kInitializationFailed; |
| 69 | 71 |
| 70 // Run the UI message loop. | 72 // Run the UI message loop. |
| 71 ui_task_runner = nullptr; | 73 ui_task_runner = nullptr; |
| 72 run_loop.Run(); | 74 run_loop.Run(); |
| 73 | 75 |
| 74 return kSuccessExitCode; | 76 return kSuccessExitCode; |
| 75 } | 77 } |
| 76 | 78 |
| 77 } // namespace remoting | 79 } // namespace remoting |
| 78 | 80 |
| 79 #if !defined(OS_WIN) | 81 #if !defined(OS_WIN) |
| 80 int main(int argc, char** argv) { | 82 int main(int argc, char** argv) { |
| 81 return remoting::HostMain(argc, argv); | 83 return remoting::HostMain(argc, argv); |
| 82 } | 84 } |
| 83 #endif // !defined(OS_WIN) | 85 #endif // !defined(OS_WIN) |
| OLD | NEW |