Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1408)

Unified Diff: remoting/host/desktop_process_main.cc

Issue 11231060: [Chromoting] The desktop process now creates a pre-connected pipe and passes (with some help of the… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/desktop_process.cc ('k') | remoting/host/desktop_process_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/desktop_process_main.cc
diff --git a/remoting/host/desktop_process.cc b/remoting/host/desktop_process_main.cc
similarity index 61%
copy from remoting/host/desktop_process.cc
copy to remoting/host/desktop_process_main.cc
index e333e717bfc495c67e60af59120dea5add68be93..bdfb8af23de3379a659d56715cc941c311490a7a 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,24 @@ 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) {
- LOG(INFO) << StringPrintf(kUsageMessage,
- UTF16ToWide(program_name.value()).c_str());
+void Usage(const FilePath& program_name) {
+ std::string display_name = UTF16ToUTF8(program_name.LossyDisplayName());
+ LOG(INFO) << StringPrintf(kUsageMessage, display_name.c_str());
}
} // 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.
@@ -125,7 +65,7 @@ int main(int argc, char** argv) {
const CommandLine* command_line = CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(kHelpSwitchName) ||
command_line->HasSwitch(kQuestionSwitchName)) {
- usage(command_line->GetProgram());
+ Usage(command_line->GetProgram());
return remoting::kSuccessExitCode;
}
@@ -133,7 +73,7 @@ int main(int argc, char** argv) {
command_line->GetSwitchValueASCII(kDaemonIpcSwitchName);
if (channel_name.empty()) {
- usage(command_line->GetProgram());
+ Usage(command_line->GetProgram());
return remoting::kUsageExitCode;
}
« no previous file with comments | « remoting/host/desktop_process.cc ('k') | remoting/host/desktop_process_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698