blob: 7b3bc12c3b5a0c4002faa33d22ac0984e9170178 [file] [log] [blame]
Yuwei Huangaeb8aa312019-05-15 23:01:211// 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 Clarkef7fb8a82019-06-06 15:41:537#include "base/task/single_thread_task_executor.h"
Yuwei Huangaeb8aa312019-05-15 23:01:218#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
18int 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 Clarkef7fb8a82019-06-06 15:41:5333 base::SingleThreadTaskExecutor io_task_executor(base::MessagePump::Type::IO);
Yuwei Huangaeb8aa312019-05-15 23:01:2134 remoting::It2MeCliHost cli_host;
35
Gabriel Charette43fd3702019-05-29 16:36:5136 base::ThreadPoolInstance::CreateAndStartWithDefaultParams("It2MeCliHost");
Yuwei Huangaeb8aa312019-05-15 23:01:2137 mojo::core::Init();
38 remoting::LoadResources("");
39
40 cli_host.Start();
41
42 return 0;
43}