OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |