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

Side by Side Diff: remoting/host/desktop_session_proxy.cc

Issue 71013004: Base: Remove Receive() from ScopedHandle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix delegate_execute for google_chrome_build Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « printing/backend/win_helper.h ('k') | remoting/host/setup/daemon_installer_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/desktop_session_proxy.h" 5 #include "remoting/host/desktop_session_proxy.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/platform_file.h" 9 #include "base/platform_file.h"
10 #include "base/process/process_handle.h" 10 #include "base/process/process_handle.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 if (!client_session_control_.get()) { 223 if (!client_session_control_.get()) {
224 base::CloseProcessHandle(desktop_process); 224 base::CloseProcessHandle(desktop_process);
225 return false; 225 return false;
226 } 226 }
227 227
228 desktop_process_ = desktop_process; 228 desktop_process_ = desktop_process;
229 229
230 #if defined(OS_WIN) 230 #if defined(OS_WIN)
231 // On Windows: |desktop_process| is a valid handle, but |desktop_pipe| needs 231 // On Windows: |desktop_process| is a valid handle, but |desktop_pipe| needs
232 // to be duplicated from the desktop process. 232 // to be duplicated from the desktop process.
233 base::win::ScopedHandle pipe; 233 HANDLE temp_handle;
234 if (!DuplicateHandle(desktop_process_, desktop_pipe, GetCurrentProcess(), 234 if (!DuplicateHandle(desktop_process_, desktop_pipe, GetCurrentProcess(),
235 pipe.Receive(), 0, FALSE, DUPLICATE_SAME_ACCESS)) { 235 &temp_handle, 0, FALSE, DUPLICATE_SAME_ACCESS)) {
236 LOG_GETLASTERROR(ERROR) << "Failed to duplicate the desktop-to-network" 236 LOG_GETLASTERROR(ERROR) << "Failed to duplicate the desktop-to-network"
237 " pipe handle"; 237 " pipe handle";
238 238
239 desktop_process_ = base::kNullProcessHandle; 239 desktop_process_ = base::kNullProcessHandle;
240 base::CloseProcessHandle(desktop_process); 240 base::CloseProcessHandle(desktop_process);
241 return false; 241 return false;
242 } 242 }
243 base::win::ScopedHandle pipe(temp_handle);
243 244
244 IPC::ChannelHandle desktop_channel_handle(pipe); 245 IPC::ChannelHandle desktop_channel_handle(pipe);
245 246
246 #elif defined(OS_POSIX) 247 #elif defined(OS_POSIX)
247 // On posix: |desktop_pipe| is a valid file descriptor. 248 // On posix: |desktop_pipe| is a valid file descriptor.
248 DCHECK(desktop_pipe.auto_close); 249 DCHECK(desktop_pipe.auto_close);
249 250
250 IPC::ChannelHandle desktop_channel_handle(std::string(), desktop_pipe); 251 IPC::ChannelHandle desktop_channel_handle(std::string(), desktop_pipe);
251 252
252 #else 253 #else
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 } 544 }
544 545
545 // static 546 // static
546 void DesktopSessionProxyTraits::Destruct( 547 void DesktopSessionProxyTraits::Destruct(
547 const DesktopSessionProxy* desktop_session_proxy) { 548 const DesktopSessionProxy* desktop_session_proxy) {
548 desktop_session_proxy->caller_task_runner_->DeleteSoon(FROM_HERE, 549 desktop_session_proxy->caller_task_runner_->DeleteSoon(FROM_HERE,
549 desktop_session_proxy); 550 desktop_session_proxy);
550 } 551 }
551 552
552 } // namespace remoting 553 } // namespace remoting
OLDNEW
« no previous file with comments | « printing/backend/win_helper.h ('k') | remoting/host/setup/daemon_installer_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698