diff options
| -rw-r--r-- | remoting/host/desktop_environment.cc | 1 | ||||
| -rw-r--r-- | remoting/host/remoting_me2me_host.cc | 30 | ||||
| -rw-r--r-- | remoting/host/session_event_executor_win.cc | 6 | ||||
| -rw-r--r-- | remoting/host/session_event_executor_win.h | 6 | ||||
| -rw-r--r-- | remoting/remoting.gyp | 13 |
5 files changed, 31 insertions, 25 deletions
diff --git a/remoting/host/desktop_environment.cc b/remoting/host/desktop_environment.cc index 179a8e3a..12d3655 100644 --- a/remoting/host/desktop_environment.cc +++ b/remoting/host/desktop_environment.cc @@ -53,7 +53,6 @@ scoped_ptr<DesktopEnvironment> DesktopEnvironment::CreateForService( #if defined(OS_WIN) event_executor.reset(new SessionEventExecutorWin( context->desktop_task_runner(), - context->file_task_runner(), event_executor.Pass())); #endif diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc index 53c14b3..be25fa3 100644 --- a/remoting/host/remoting_me2me_host.cc +++ b/remoting/host/remoting_me2me_host.cc @@ -24,6 +24,8 @@ #include "base/win/windows_version.h" #include "build/build_config.h" #include "crypto/nss_util.h" +#include "ipc/ipc_channel.h" +#include "ipc/ipc_channel_proxy.h" #include "net/base/network_change_notifier.h" #include "net/socket/ssl_server_socket.h" #include "remoting/base/breakpad.h" @@ -73,6 +75,9 @@ namespace { // This is used for tagging system event logs. const char kApplicationName[] = "chromoting"; +// The command line switch specifying the name of the Chromoting IPC channel. +const char kDaemonIpcSwitchName[] = "chromoting-ipc"; + // These are used for parsing the config-file locations from the command line, // and for defining the default locations if the switches are not present. const char kAuthConfigSwitchName[] = "auth-config"; @@ -97,7 +102,8 @@ const char kOfficialOAuth2ClientSecret[] = "Bgur6DFiOMM1h8x-AQpuTQlK"; namespace remoting { class HostProcess - : public HeartbeatSender::Listener { + : public HeartbeatSender::Listener, + public IPC::Listener { public: HostProcess() : message_loop_(MessageLoop::TYPE_UI), @@ -127,6 +133,21 @@ class HostProcess } bool InitWithCommandLine(const CommandLine* cmd_line) { + // Connect to the daemon process. + std::string channel_name = + cmd_line->GetSwitchValueASCII(kDaemonIpcSwitchName); + +#if defined(REMOTING_MULTI_PROCESS) + if (channel_name.empty()) + return false; +#endif // defined(REMOTING_MULTI_PROCESS) + + if (!channel_name.empty()) { + daemon_channel_.reset(new IPC::ChannelProxy( + channel_name, IPC::Channel::MODE_CLIENT, this, + context_->network_task_runner())); + } + FilePath default_config_dir = remoting::GetConfigDir(); if (cmd_line->HasSwitch(kAuthConfigSwitchName)) { FilePath path = cmd_line->GetSwitchValuePath(kAuthConfigSwitchName); @@ -217,6 +238,11 @@ class HostProcess host_->SetAuthenticatorFactory(factory.Pass()); } + // IPC::Listener implementation. + virtual bool OnMessageReceived(const IPC::Message& message) { + return false; + } + int Run() { if (!LoadConfig()) { return kInvalidHostConfigurationExitCode; @@ -240,6 +266,7 @@ class HostProcess host_user_interface_.reset(); #endif + daemon_channel_.reset(); base::WaitableEvent done_event(true, false); policy_watcher_->StopWatching(&done_event); done_event.Wait(); @@ -573,6 +600,7 @@ class HostProcess MessageLoop message_loop_; scoped_ptr<ChromotingHostContext> context_; + scoped_ptr<IPC::ChannelProxy> daemon_channel_; scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; FilePath host_config_path_; diff --git a/remoting/host/session_event_executor_win.cc b/remoting/host/session_event_executor_win.cc index 617a381..9fc2834 100644 --- a/remoting/host/session_event_executor_win.cc +++ b/remoting/host/session_event_executor_win.cc @@ -7,13 +7,10 @@ #include <string> #include "base/bind.h" -#include "base/command_line.h" #include "base/compiler_specific.h" +#include "base/location.h" #include "base/single_thread_task_runner.h" #include "base/win/windows_version.h" -#include "ipc/ipc_channel.h" -#include "ipc/ipc_channel_proxy.h" -#include "remoting/host/chromoting_messages.h" #include "remoting/host/sas_injector.h" #include "remoting/host/win/desktop.h" #include "remoting/proto/event.pb.h" @@ -45,7 +42,6 @@ using protocol::KeyEvent; SessionEventExecutorWin::SessionEventExecutorWin( scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, - scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, scoped_ptr<EventExecutor> nested_executor) : nested_executor_(nested_executor.Pass()), task_runner_(main_task_runner), diff --git a/remoting/host/session_event_executor_win.h b/remoting/host/session_event_executor_win.h index 26355e3..b6d48bf 100644 --- a/remoting/host/session_event_executor_win.h +++ b/remoting/host/session_event_executor_win.h @@ -10,7 +10,6 @@ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" -#include "ipc/ipc_channel.h" #include "remoting/host/event_executor.h" #include "remoting/host/win/scoped_thread_desktop.h" @@ -18,10 +17,6 @@ namespace base { class SingleThreadTaskRunner; } // namespace base -namespace IPC { -class ChannelProxy; -} // namespace IPC - namespace remoting { class SasInjector; @@ -30,7 +25,6 @@ class SessionEventExecutorWin : public EventExecutor { public: SessionEventExecutorWin( scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, - scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, scoped_ptr<EventExecutor> nested_executor); ~SessionEventExecutorWin(); diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp index 8c273d1..79b4fa0 100644 --- a/remoting/remoting.gyp +++ b/remoting/remoting.gyp @@ -993,7 +993,6 @@ [ 'OS=="win"', { 'dependencies': [ '../google_update/google_update.gyp:google_update', - '../ipc/ipc.gyp:ipc', 'remoting_elevated_controller', 'remoting_version_resources', ], @@ -1415,13 +1414,6 @@ 'sources': [ 'host/simple_host_process.cc', ], - 'conditions': [ - ['OS=="win"', { - 'dependencies': [ - '../ipc/ipc.gyp:ipc' - ], - }], - ], }, # end of target 'remoting_simple_host' { @@ -1436,6 +1428,7 @@ 'remoting_jingle_glue', '../base/base.gyp:base', '../base/base.gyp:base_i18n', + '../ipc/ipc.gyp:ipc', '../media/media.gyp:media', '../net/net.gyp:net', ], @@ -1477,7 +1470,6 @@ }], ['OS=="win"', { 'dependencies': [ - '../ipc/ipc.gyp:ipc', 'remoting_version_resources', ], 'sources': [ @@ -1801,9 +1793,6 @@ 'include_dirs': [ '../breakpad/src', ], - 'dependencies': [ - '../ipc/ipc.gyp:ipc' - ], 'link_settings': { 'libraries': [ '-lrpcrt4.lib', |
