Yuwei Huang | aeb8aa31 | 2019-05-15 23:01:21 | [diff] [blame] | 1 | // Copyright 2019 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "base/at_exit.h" |
| 6 | #include "base/command_line.h" |
Alex Clarke | f7fb8a8 | 2019-06-06 15:41:53 | [diff] [blame] | 7 | #include "base/task/single_thread_task_executor.h" |
Yuwei Huang | aeb8aa31 | 2019-05-15 23:01:21 | [diff] [blame] | 8 | #include "base/task/thread_pool/thread_pool.h" |
| 9 | #include "build/build_config.h" |
| 10 | #include "mojo/core/embedder/embedder.h" |
| 11 | #include "remoting/host/resources.h" |
| 12 | #include "remoting/test/it2me_cli_host.h" |
| 13 | |
| 14 | #if defined(OS_LINUX) |
| 15 | #include "base/linux_util.h" |
| 16 | #endif // defined(OS_LINUX) |
| 17 | |
| 18 | int main(int argc, char const* argv[]) { |
| 19 | base::AtExitManager exitManager; |
| 20 | base::CommandLine::Init(argc, argv); |
| 21 | |
| 22 | if (remoting::It2MeCliHost::ShouldPrintHelp()) { |
| 23 | remoting::It2MeCliHost::PrintHelp(); |
| 24 | return 0; |
| 25 | } |
| 26 | |
| 27 | #if defined(OS_LINUX) |
| 28 | // Need to prime the host OS version value for linux to prevent IO on the |
| 29 | // network thread. base::GetLinuxDistro() caches the result. |
| 30 | base::GetLinuxDistro(); |
| 31 | #endif // OS_LINUX |
| 32 | |
Alex Clarke | f7fb8a8 | 2019-06-06 15:41:53 | [diff] [blame] | 33 | base::SingleThreadTaskExecutor io_task_executor(base::MessagePump::Type::IO); |
Yuwei Huang | aeb8aa31 | 2019-05-15 23:01:21 | [diff] [blame] | 34 | remoting::It2MeCliHost cli_host; |
| 35 | |
Gabriel Charette | 43fd370 | 2019-05-29 16:36:51 | [diff] [blame] | 36 | base::ThreadPoolInstance::CreateAndStartWithDefaultParams("It2MeCliHost"); |
Yuwei Huang | aeb8aa31 | 2019-05-15 23:01:21 | [diff] [blame] | 37 | mojo::core::Init(); |
| 38 | remoting::LoadResources(""); |
| 39 | |
| 40 | cli_host.Start(); |
| 41 | |
| 42 | return 0; |
| 43 | } |