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())); |
+ } |
} |
} |