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

Unified Diff: ipc/ipc_channel_proxy.cc

Issue 2158893002: Fix data race in IPC::ChannelProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « build/sanitizers/tsan_suppressions.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_proxy.cc
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index 5ac51cdf961e02fd629b06404c7b7051c7235709..a4176b0a4bd339c076d7c3bedab9ae1b963ddb9d 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -324,12 +324,15 @@ void ChannelProxy::Context::OnDispatchConnected() {
if (channel_connected_called_)
return;
- if (channel_) {
- Channel::AssociatedInterfaceSupport* associated_interface_support =
- channel_->GetAssociatedInterfaceSupport();
- if (associated_interface_support) {
- channel_associated_group_.reset(new mojo::AssociatedGroup(
- *associated_interface_support->GetAssociatedGroup()));
+ {
+ base::AutoLock l(channel_lifetime_lock_);
+ if (channel_) {
+ Channel::AssociatedInterfaceSupport* associated_interface_support =
+ channel_->GetAssociatedInterfaceSupport();
+ if (associated_interface_support) {
+ channel_associated_group_.reset(new mojo::AssociatedGroup(
+ *associated_interface_support->GetAssociatedGroup()));
+ }
}
}
« no previous file with comments | « build/sanitizers/tsan_suppressions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698