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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « build/sanitizers/tsan_suppressions.cc ('k') | no next file » | 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 "ipc/ipc_channel_proxy.h" 5 #include "ipc/ipc_channel_proxy.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 if (logger->Enabled()) 317 if (logger->Enabled())
318 logger->OnPostDispatchMessage(message, channel_id_); 318 logger->OnPostDispatchMessage(message, channel_id_);
319 #endif 319 #endif
320 } 320 }
321 321
322 // Called on the listener's thread 322 // Called on the listener's thread
323 void ChannelProxy::Context::OnDispatchConnected() { 323 void ChannelProxy::Context::OnDispatchConnected() {
324 if (channel_connected_called_) 324 if (channel_connected_called_)
325 return; 325 return;
326 326
327 if (channel_) { 327 {
328 Channel::AssociatedInterfaceSupport* associated_interface_support = 328 base::AutoLock l(channel_lifetime_lock_);
329 channel_->GetAssociatedInterfaceSupport(); 329 if (channel_) {
330 if (associated_interface_support) { 330 Channel::AssociatedInterfaceSupport* associated_interface_support =
331 channel_associated_group_.reset(new mojo::AssociatedGroup( 331 channel_->GetAssociatedInterfaceSupport();
332 *associated_interface_support->GetAssociatedGroup())); 332 if (associated_interface_support) {
333 channel_associated_group_.reset(new mojo::AssociatedGroup(
334 *associated_interface_support->GetAssociatedGroup()));
335 }
333 } 336 }
334 } 337 }
335 338
336 channel_connected_called_ = true; 339 channel_connected_called_ = true;
337 if (listener_) 340 if (listener_)
338 listener_->OnChannelConnected(peer_pid_); 341 listener_->OnChannelConnected(peer_pid_);
339 } 342 }
340 343
341 // Called on the listener's thread 344 // Called on the listener's thread
342 void ChannelProxy::Context::OnDispatchError() { 345 void ChannelProxy::Context::OnDispatchError() {
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 return channel->TakeClientFileDescriptor(); 596 return channel->TakeClientFileDescriptor();
594 } 597 }
595 #endif 598 #endif
596 599
597 void ChannelProxy::OnChannelInit() { 600 void ChannelProxy::OnChannelInit() {
598 } 601 }
599 602
600 //----------------------------------------------------------------------------- 603 //-----------------------------------------------------------------------------
601 604
602 } // namespace IPC 605 } // namespace IPC
OLDNEW
« 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