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

Unified Diff: remoting/host/daemon_process_win.cc

Issue 12096071: Adding a unit test to verify the IPC channel between the network and desktop processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix posix #2 Created 7 years, 10 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/chromoting_messages.h ('k') | remoting/host/desktop_process_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/daemon_process_win.cc
diff --git a/remoting/host/daemon_process_win.cc b/remoting/host/daemon_process_win.cc
index 51ee12a6ec452410db27157220b52d40b929af24..9c9ea48d13f78ff07f0f0133dd0631d62e6cf207 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;
« no previous file with comments | « remoting/host/chromoting_messages.h ('k') | remoting/host/desktop_process_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698