This source file includes following definitions.
- DesktopProcessMain
- main
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "remoting/base/auto_thread.h"
#include "remoting/base/auto_thread_task_runner.h"
#include "remoting/host/desktop_process.h"
#include "remoting/host/host_exit_codes.h"
#include "remoting/host/host_main.h"
#include "remoting/host/ipc_constants.h"
#include "remoting/host/me2me_desktop_environment.h"
#include "remoting/host/win/session_desktop_environment.h"
namespace remoting {
int DesktopProcessMain() {
const CommandLine* command_line = CommandLine::ForCurrentProcess();
std::string channel_name =
command_line->GetSwitchValueASCII(kDaemonPipeSwitchName);
if (channel_name.empty())
return kUsageExitCode;
base::MessageLoopForUI message_loop;
base::RunLoop run_loop;
scoped_refptr<AutoThreadTaskRunner> ui_task_runner =
new AutoThreadTaskRunner(message_loop.message_loop_proxy(),
run_loop.QuitClosure());
scoped_refptr<AutoThreadTaskRunner> input_task_runner =
AutoThread::CreateWithType(
"Input thread", ui_task_runner, base::MessageLoop::TYPE_IO);
DesktopProcess desktop_process(ui_task_runner,
input_task_runner,
channel_name);
scoped_ptr<DesktopEnvironmentFactory> desktop_environment_factory;
#if defined(OS_WIN)
desktop_environment_factory.reset(
new SessionDesktopEnvironmentFactory(
ui_task_runner,
input_task_runner,
ui_task_runner,
base::Bind(&DesktopProcess::InjectSas,
desktop_process.AsWeakPtr())));
#else
desktop_environment_factory.reset(new Me2MeDesktopEnvironmentFactory(
ui_task_runner,
input_task_runner,
ui_task_runner));
#endif
if (!desktop_process.Start(desktop_environment_factory.Pass()))
return kInitializationFailed;
ui_task_runner = NULL;
run_loop.Run();
return kSuccessExitCode;
}
}
#if !defined(OS_WIN)
int main(int argc, char** argv) {
return remoting::HostMain(argc, argv);
}
#endif