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

Unified Diff: remoting/host/desktop_session_agent.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, 8 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_process.cc ('k') | remoting/host/ipc_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/desktop_session_agent.cc
diff --git a/remoting/host/desktop_session_agent.cc b/remoting/host/desktop_session_agent.cc
index 26ee9e1a9d98754daffb3b9e334cd0edbce43c02..064845c969e60854e462bba628e631b7c69b8e79 100644
--- a/remoting/host/desktop_session_agent.cc
+++ b/remoting/host/desktop_session_agent.cc
@@ -13,6 +13,7 @@
#include "base/memory/shared_memory.h"
#include "base/process/process_handle.h"
#include "build/build_config.h"
+#include "ipc/attachment_broker.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_message_macros.h"
@@ -215,6 +216,10 @@ void DesktopSessionAgent::OnChannelError() {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
// Make sure the channel is closed.
+ if (IPC::AttachmentBroker::GetGlobal()) {
+ IPC::AttachmentBroker::GetGlobal()->DeregisterCommunicationChannel(
+ network_channel_.get());
+ }
network_channel_.reset();
desktop_pipe_.Close();
@@ -413,6 +418,10 @@ void DesktopSessionAgent::Stop() {
delegate_.reset();
// Make sure the channel is closed.
+ if (IPC::AttachmentBroker::GetGlobal()) {
+ IPC::AttachmentBroker::GetGlobal()->DeregisterCommunicationChannel(
+ network_channel_.get());
+ }
network_channel_.reset();
if (started_) {
« no previous file with comments | « remoting/host/desktop_process.cc ('k') | remoting/host/ipc_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698