Chromium Code Reviews| Index: remoting/host/desktop_process_main.cc |
| diff --git a/remoting/host/desktop_process.cc b/remoting/host/desktop_process_main.cc |
| similarity index 64% |
| copy from remoting/host/desktop_process.cc |
| copy to remoting/host/desktop_process_main.cc |
| index e333e717bfc495c67e60af59120dea5add68be93..19d015ccb6c7eb137459e73a87fbae5021df7d3d 100644 |
| --- a/remoting/host/desktop_process.cc |
| +++ b/remoting/host/desktop_process_main.cc |
| @@ -5,21 +5,14 @@ |
| // This file implements the Windows service controlling Me2Me host processes |
| // running within user sessions. |
| -#include "remoting/host/desktop_process.h" |
| - |
| #include "base/at_exit.h" |
| #include "base/command_line.h" |
| #include "base/file_path.h" |
| -#include "base/memory/ref_counted.h" |
| -#include "base/message_loop.h" |
| -#include "base/run_loop.h" |
| #include "base/scoped_native_library.h" |
| #include "base/stringprintf.h" |
| #include "base/utf_string_conversions.h" |
| #include "base/win/windows_version.h" |
| -#include "ipc/ipc_channel_proxy.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/logging.h" |
| #include "remoting/host/usage_stats_consent.h" |
| @@ -37,77 +30,28 @@ namespace { |
| // The command line switch specifying the name of the daemon IPC endpoint. |
| const char kDaemonIpcSwitchName[] = "daemon-pipe"; |
| -const char kIoThreadName[] = "I/O thread"; |
| - |
| // "--help" or "--?" prints the usage message. |
| const char kHelpSwitchName[] = "help"; |
| const char kQuestionSwitchName[] = "?"; |
| -const wchar_t kUsageMessage[] = |
| - L"\n" |
| - L"Usage: %ls [options]\n" |
| - L"\n" |
| - L"Options:\n" |
| - L" --help, --? - Print this message.\n"; |
| +const char kUsageMessage[] = |
| + "\n" |
| + "Usage: %s [options]\n" |
| + "\n" |
| + "Options:\n" |
| + " --help, --? - Print this message.\n"; |
| void usage(const FilePath& program_name) { |
|
Sergey Ulanov
2012/10/24 20:12:01
nit: Usage()
alexeypa (please no reviews)
2012/10/24 21:41:51
Done.
|
| +#if defined(OS_POSIX) |
| + LOG(INFO) << StringPrintf(kUsageMessage, program_name.value().c_str()); |
|
Sergey Ulanov
2012/10/24 20:12:01
AsUTF8Unsafe() instead of value() and you won't ne
alexeypa (please no reviews)
2012/10/24 21:41:51
Done.
|
| +#elif defined(OS_WIN) |
| LOG(INFO) << StringPrintf(kUsageMessage, |
| - UTF16ToWide(program_name.value()).c_str()); |
| + UTF16ToUTF8(program_name.value()).c_str()); |
| +#endif // OS_WIN |
| } |
| } // namespace |
| -namespace remoting { |
| - |
| -DesktopProcess::DesktopProcess(const std::string& daemon_channel_name) |
| - : daemon_channel_name_(daemon_channel_name) { |
| -} |
| - |
| -DesktopProcess::~DesktopProcess() { |
| -} |
| - |
| -bool DesktopProcess::OnMessageReceived(const IPC::Message& message) { |
| - return false; |
| -} |
| - |
| -void DesktopProcess::OnChannelConnected(int32 peer_pid) { |
| - NOTIMPLEMENTED(); |
| -} |
| - |
| -void DesktopProcess::OnChannelError() { |
| - LOG(ERROR) << "Failed to connect to '" << daemon_channel_name_ << "'"; |
| - daemon_channel_.reset(); |
| -} |
| - |
| -int DesktopProcess::Run() { |
| - // Create the UI message loop. |
| - MessageLoop message_loop(MessageLoop::TYPE_UI); |
| - |
| - { |
| - scoped_refptr<AutoThreadTaskRunner> ui_task_runner = |
| - new remoting::AutoThreadTaskRunner(message_loop.message_loop_proxy(), |
| - MessageLoop::QuitClosure()); |
| - |
| - // Launch the I/O thread. |
| - scoped_refptr<AutoThreadTaskRunner> io_task_runner = |
| - AutoThread::CreateWithType(kIoThreadName, ui_task_runner, |
| - MessageLoop::TYPE_IO); |
| - |
| - // Connect to the daemon. |
| - daemon_channel_.reset(new IPC::ChannelProxy(daemon_channel_name_, |
| - IPC::Channel::MODE_CLIENT, |
| - this, |
| - io_task_runner)); |
| - } |
| - |
| - // Run the UI message loop. |
| - base::RunLoop run_loop; |
| - run_loop.Run(); |
| - return 0; |
| -} |
| - |
| -} // namespace remoting |
| - |
| int main(int argc, char** argv) { |
| #if defined(OS_MACOSX) |
| // Needed so we don't leak objects when threads are created. |