diff options
author | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-07 05:54:23 +0000 |
---|---|---|
committer | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-07 05:54:23 +0000 |
commit | 5de788d86f799edb83a1c3a320d3326a85434d1a (patch) | |
tree | 917d9766fe5bea9a2a4dca8dde350df3e356919c /remoting/host/daemon_process_win.cc | |
parent | f9721f1c14c4b1904e56c4db3d381b61d1049831 (diff) | |
download | chromium_src-5de788d86f799edb83a1c3a320d3326a85434d1a.zip chromium_src-5de788d86f799edb83a1c3a320d3326a85434d1a.tar.gz chromium_src-5de788d86f799edb83a1c3a320d3326a85434d1a.tar.bz2 |
Adding a unit test to verify the IPC channel between the network and desktop processes.
Related changes:
- The fake screen capturer now uses shared buffers when they available.
- DesktopSessionAgent frees the client end handle of the network-to-desktop pipe once the connection has been established.
BUG=134694
Review URL: https://chromiumcodereview.appspot.com/12096071
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181221 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/daemon_process_win.cc')
-rw-r--r-- | remoting/host/daemon_process_win.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/remoting/host/daemon_process_win.cc b/remoting/host/daemon_process_win.cc index 51ee12a..9c9ea48 100644 --- a/remoting/host/daemon_process_win.cc +++ b/remoting/host/daemon_process_win.cc @@ -10,6 +10,7 @@ #include "base/logging.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" +#include "base/process.h" #include "base/single_thread_task_runner.h" #include "base/time.h" #include "base/timer.h" @@ -108,15 +109,20 @@ bool DaemonProcessWin::OnDesktopSessionAgentAttached( base::ProcessHandle desktop_process, IPC::PlatformFileForTransit desktop_pipe) { // Prepare |desktop_process| handle for sending over to the network process. - // |desktop_pipe| is a handle in the desktop process. It will be duplicated - // by the network process directly from the desktop process. - IPC::PlatformFileForTransit desktop_process_for_transit = - IPC::GetFileHandleForProcess(desktop_process, network_process_, false); - if (desktop_process_for_transit == IPC::InvalidPlatformFileForTransit()) { - LOG(ERROR) << "Failed to duplicate the desktop process handle"; + base::ProcessHandle desktop_process_for_transit; + if (!DuplicateHandle(GetCurrentProcess(), + desktop_process, + network_process_, + &desktop_process_for_transit, + 0, + FALSE, + DUPLICATE_SAME_ACCESS)) { + LOG_GETLASTERROR(ERROR) << "Failed to duplicate the desktop process handle"; return false; } + // |desktop_pipe| is a handle in the desktop process. It will be duplicated + // by the network process directly from the desktop process. SendToNetwork(new ChromotingDaemonNetworkMsg_DesktopAttached( terminal_id, desktop_process_for_transit, desktop_pipe)); return true; |