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

Side by Side Diff: remoting/host/win/unprivileged_process_delegate.cc

Issue 1903663004: IPC: Fix attachment brokering race condition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase (scoped_ptr->std::unique_ptr) Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « remoting/host/remoting_me2me_host.cc ('k') | remoting/host/win/wts_session_process_delegate.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 1
2 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 // 5 //
6 // This file implements the Windows service controlling Me2Me host processes 6 // This file implements the Windows service controlling Me2Me host processes
7 // running within user sessions. 7 // running within user sessions.
8 8
9 #include "remoting/host/win/unprivileged_process_delegate.h" 9 #include "remoting/host/win/unprivileged_process_delegate.h"
10 10
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 if (!LaunchProcessWithToken( 330 if (!LaunchProcessWithToken(
331 command_line.GetProgram(), command_line.GetCommandLineString(), 331 command_line.GetProgram(), command_line.GetCommandLineString(),
332 token.Get(), &process_attributes, &thread_attributes, true, 0, 332 token.Get(), &process_attributes, &thread_attributes, true, 0,
333 nullptr, &worker_process, &worker_thread)) { 333 nullptr, &worker_process, &worker_thread)) {
334 ReportFatalError(); 334 ReportFatalError();
335 return; 335 return;
336 } 336 }
337 } 337 }
338 338
339 channel_ = std::move(server); 339 channel_ = std::move(server);
340 IPC::AttachmentBroker::GetGlobal()->RegisterCommunicationChannel(
341 channel_.get(), io_task_runner_);
342 340
343 ReportProcessLaunched(std::move(worker_process)); 341 ReportProcessLaunched(std::move(worker_process));
344 } 342 }
345 343
346 void UnprivilegedProcessDelegate::Send(IPC::Message* message) { 344 void UnprivilegedProcessDelegate::Send(IPC::Message* message) {
347 DCHECK(CalledOnValidThread()); 345 DCHECK(CalledOnValidThread());
348 346
349 if (channel_) { 347 if (channel_) {
350 channel_->Send(message); 348 channel_->Send(message);
351 } else { 349 } else {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 PLOG(ERROR) << "Failed to duplicate a handle"; 430 PLOG(ERROR) << "Failed to duplicate a handle";
433 ReportFatalError(); 431 ReportFatalError();
434 return; 432 return;
435 } 433 }
436 ScopedHandle limited_handle(temp_handle); 434 ScopedHandle limited_handle(temp_handle);
437 435
438 event_handler_->OnProcessLaunched(std::move(limited_handle)); 436 event_handler_->OnProcessLaunched(std::move(limited_handle));
439 } 437 }
440 438
441 } // namespace remoting 439 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/remoting_me2me_host.cc ('k') | remoting/host/win/wts_session_process_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698