OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "remoting/host/security_key/remote_security_key_main.h" | 5 #include "remoting/host/security_key/remote_security_key_main.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 SetStdHandle(STD_OUTPUT_HANDLE, nullptr); | 134 SetStdHandle(STD_OUTPUT_HANDLE, nullptr); |
135 #elif defined(OS_POSIX) | 135 #elif defined(OS_POSIX) |
136 // The files are automatically closed. | 136 // The files are automatically closed. |
137 base::File read_file(STDIN_FILENO); | 137 base::File read_file(STDIN_FILENO); |
138 base::File write_file(STDOUT_FILENO); | 138 base::File write_file(STDOUT_FILENO); |
139 #else | 139 #else |
140 #error Not implemented. | 140 #error Not implemented. |
141 #endif | 141 #endif |
142 | 142 |
143 mojo::edk::Init(); | 143 mojo::edk::Init(); |
144 mojo::edk::ScopedIPCSupport ipc_support(base::ThreadTaskRunnerHandle::Get()); | 144 mojo::edk::ScopedIPCSupport ipc_support( |
| 145 base::ThreadTaskRunnerHandle::Get(), |
| 146 mojo::edk::ScopedIPCSupport::ShutdownPolicy::FAST); |
145 | 147 |
146 base::RunLoop run_loop; | 148 base::RunLoop run_loop; |
147 | 149 |
148 std::unique_ptr<SecurityKeyIpcClient> ipc_client(new SecurityKeyIpcClient()); | 150 std::unique_ptr<SecurityKeyIpcClient> ipc_client(new SecurityKeyIpcClient()); |
149 | 151 |
150 SecurityKeyMessageHandler message_handler; | 152 SecurityKeyMessageHandler message_handler; |
151 message_handler.Start(std::move(read_file), std::move(write_file), | 153 message_handler.Start(std::move(read_file), std::move(write_file), |
152 std::move(ipc_client), run_loop.QuitClosure()); | 154 std::move(ipc_client), run_loop.QuitClosure()); |
153 | 155 |
154 run_loop.Run(); | 156 run_loop.Run(); |
155 | 157 |
156 return kSuccessExitCode; | 158 return kSuccessExitCode; |
157 } | 159 } |
158 | 160 |
159 int RemoteSecurityKeyMain(int argc, char** argv) { | 161 int RemoteSecurityKeyMain(int argc, char** argv) { |
160 // This object instance is required by Chrome classes (such as MessageLoop). | 162 // This object instance is required by Chrome classes (such as MessageLoop). |
161 base::AtExitManager exit_manager; | 163 base::AtExitManager exit_manager; |
162 base::MessageLoopForIO message_loop; | 164 base::MessageLoopForIO message_loop; |
163 | 165 |
164 base::CommandLine::Init(argc, argv); | 166 base::CommandLine::Init(argc, argv); |
165 remoting::InitHostLogging(); | 167 remoting::InitHostLogging(); |
166 | 168 |
167 return StartRemoteSecurityKey(); | 169 return StartRemoteSecurityKey(); |
168 } | 170 } |
169 | 171 |
170 } // namespace remoting | 172 } // namespace remoting |
OLD | NEW |