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

Unified Diff: remoting/host/desktop_session_proxy.cc

Issue 1830853002: Make PlatformFileForTransit a class on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from mseaborn. Created 4 years, 9 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/desktop_session_agent.cc ('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/desktop_session_proxy.cc
diff --git a/remoting/host/desktop_session_proxy.cc b/remoting/host/desktop_session_proxy.cc
index 4dbe6392b058a2624f9ab1068527c444e099f193..a13c4171411c1f9451c0ead14963c1caaedc594c 100644
--- a/remoting/host/desktop_session_proxy.cc
+++ b/remoting/host/desktop_session_proxy.cc
@@ -221,27 +221,13 @@ bool DesktopSessionProxy::AttachToDesktop(
desktop_process_ = std::move(desktop_process);
#if defined(OS_WIN)
- // On Windows: |desktop_process| is a valid handle, but |desktop_pipe| needs
- // to be duplicated from the desktop process.
- HANDLE temp_handle;
- if (!DuplicateHandle(desktop_process_.Handle(), desktop_pipe,
- GetCurrentProcess(), &temp_handle, 0,
- FALSE, DUPLICATE_SAME_ACCESS)) {
- PLOG(ERROR) << "Failed to duplicate the desktop-to-network pipe handle";
-
- desktop_process_.Close();
- return false;
- }
- base::win::ScopedHandle pipe(temp_handle);
-
+ base::win::ScopedHandle pipe(desktop_pipe.GetHandle());
IPC::ChannelHandle desktop_channel_handle(pipe.Get());
-
#elif defined(OS_POSIX)
// On posix: |desktop_pipe| is a valid file descriptor.
DCHECK(desktop_pipe.auto_close);
IPC::ChannelHandle desktop_channel_handle(std::string(), desktop_pipe);
-
#else
#error Unsupported platform.
#endif
« no previous file with comments | « remoting/host/desktop_session_agent.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698