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

Unified Diff: remoting/host/remoting_me2me_host.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/ipc_desktop_environment_factory.cc ('k') | remoting/host/win/host_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/remoting_me2me_host.cc
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index 0f8c94ac77c8316d587b4aeb80ce4ed6089894b3..edc74e1d40b3fe74a781aa112f1e0a4092ba40bc 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -27,6 +27,7 @@
#include "google_apis/google_api_keys.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_channel_proxy.h"
+#include "ipc/ipc_listener.h"
#include "net/base/network_change_notifier.h"
#include "net/socket/ssl_server_socket.h"
#include "remoting/base/auto_thread_task_runner.h"
@@ -132,7 +133,8 @@ class HostProcess
void CreateAuthenticatorFactory();
// IPC::Listener implementation.
- virtual bool OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual void OnChannelError() OVERRIDE;
// HeartbeatSender::Listener overrides.
virtual void OnUnknownHostIdError() OVERRIDE;
@@ -181,6 +183,13 @@ class HostProcess
void ResetHost();
+ // Crashes the process in response to a daemon's request. The daemon passes
+ // the location of the code that detected the fatal error resulted in this
+ // request.
+ void OnCrash(const std::string& function_name,
+ const std::string& file_name,
+ const int& line_number);
+
scoped_ptr<ChromotingHostContext> context_;
scoped_ptr<IPC::ChannelProxy> daemon_channel_;
scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_;
@@ -246,15 +255,6 @@ HostProcess::HostProcess(scoped_ptr<ChromotingHostContext> context)
base::Unretained(this)));
}
-// Crashes the process in response to a daemon's request. The daemon passes
-// the location of the code that detected the fatal error resulted in this
-// request.
-void OnCrash(const std::string& function_name,
- const std::string& file_name,
- const int& line_number) {
- CHECK(false);
-}
-
bool HostProcess::InitWithCommandLine(const CommandLine* cmd_line) {
#if defined(REMOTING_MULTI_PROCESS)
// Parse the handle value and convert it to a handle/file descriptor.
@@ -405,6 +405,10 @@ bool HostProcess::OnMessageReceived(const IPC::Message& message) {
OnCrash)
IPC_MESSAGE_HANDLER(ChromotingDaemonNetworkMsg_Configuration,
OnConfigUpdated)
+ IPC_MESSAGE_FORWARD(
+ ChromotingDaemonNetworkMsg_DesktopAttached,
+ desktop_session_connector_,
+ DesktopSessionConnector::OnDesktopSessionAgentAttached)
IPC_MESSAGE_FORWARD(ChromotingDaemonNetworkMsg_TerminalDisconnected,
desktop_session_connector_,
DesktopSessionConnector::OnTerminalDisconnected)
@@ -416,6 +420,16 @@ bool HostProcess::OnMessageReceived(const IPC::Message& message) {
#endif // !defined(REMOTING_MULTI_PROCESS)
}
+void HostProcess::OnChannelError() {
+ DCHECK(context_->ui_task_runner()->BelongsToCurrentThread());
+
+ // Shutdown the host if the daemon disconnected the channel.
+ context_->network_task_runner()->PostTask(
+ FROM_HERE,
+ base::Bind(&HostProcess::Shutdown, base::Unretained(this),
+ kSuccessExitCode));
+}
+
void HostProcess::StartHostProcess() {
DCHECK(context_->ui_task_runner()->BelongsToCurrentThread());
@@ -830,6 +844,12 @@ void HostProcess::ResetHost() {
resizing_host_observer_.reset();
}
+void HostProcess::OnCrash(const std::string& function_name,
+ const std::string& file_name,
+ const int& line_number) {
+ CHECK(false);
+}
+
} // namespace remoting
int main(int argc, char** argv) {
« no previous file with comments | « remoting/host/ipc_desktop_environment_factory.cc ('k') | remoting/host/win/host_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698