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

Unified Diff: remoting/host/ipc_desktop_environment_factory.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.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/ipc_desktop_environment_factory.cc
diff --git a/remoting/host/ipc_desktop_environment_factory.cc b/remoting/host/ipc_desktop_environment_factory.cc
index 07c35803d188c852274861cc72ec987025287740..6adef35360f21caf5eedcbfae8bf5e83a812dd82 100644
--- a/remoting/host/ipc_desktop_environment_factory.cc
+++ b/remoting/host/ipc_desktop_environment_factory.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "ipc/ipc_channel_proxy.h"
+#include "base/platform_file.h"
#include "remoting/host/audio_capturer.h"
#include "remoting/host/chromoting_host.h"
#include "remoting/host/chromoting_host_context.h"
@@ -37,7 +38,7 @@ scoped_ptr<DesktopEnvironment> IpcDesktopEnvironmentFactory::Create(
DCHECK(network_task_runner_->BelongsToCurrentThread());
return scoped_ptr<DesktopEnvironment>(new IpcDesktopEnvironment(
- input_task_runner_, ui_task_runner_, this, client));
+ input_task_runner_, network_task_runner_, ui_task_runner_, this, client));
}
void IpcDesktopEnvironmentFactory::ConnectTerminal(
@@ -72,6 +73,33 @@ void IpcDesktopEnvironmentFactory::DisconnectTerminal(
}
}
+void IpcDesktopEnvironmentFactory::OnDesktopSessionAgentAttached(
+ int terminal_id,
+ IPC::PlatformFileForTransit desktop_process,
+ IPC::PlatformFileForTransit desktop_pipe) {
+ if (!network_task_runner_->BelongsToCurrentThread()) {
+ network_task_runner_->PostTask(FROM_HERE, base::Bind(
+ &IpcDesktopEnvironmentFactory::OnDesktopSessionAgentAttached,
+ base::Unretained(this), terminal_id, desktop_process, desktop_pipe));
+ return;
+ }
+
+ ActiveConnectionsList::iterator i = active_connections_.find(terminal_id);
+ if (i != active_connections_.end()) {
+ i->second->OnDesktopSessionAgentAttached(desktop_process, desktop_pipe);
+ } else {
+#if defined(OS_POSIX)
+ DCHECK(desktop_process.auto_close);
+ DCHECK(desktop_pipe.auto_close);
+
+ base::ClosePlatformFile(desktop_process.fd);
+ base::ClosePlatformFile(desktop_pipe.fd);
+#elif defined(OS_WIN)
+ base::ClosePlatformFile(desktop_process);
+#endif // defined(OS_WIN)
+ }
+}
+
void IpcDesktopEnvironmentFactory::OnTerminalDisconnected(int terminal_id) {
if (!network_task_runner_->BelongsToCurrentThread()) {
network_task_runner_->PostTask(FROM_HERE, base::Bind(
@@ -80,8 +108,7 @@ void IpcDesktopEnvironmentFactory::OnTerminalDisconnected(int terminal_id) {
return;
}
- ActiveConnectionsList::iterator i =
- active_connections_.find(terminal_id);
+ ActiveConnectionsList::iterator i = active_connections_.find(terminal_id);
if (i != active_connections_.end()) {
IpcDesktopEnvironment* desktop_environment = i->second;
active_connections_.erase(i);
« no previous file with comments | « remoting/host/ipc_desktop_environment_factory.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698