Index: ipc/ipc_channel_proxy.cc |
=================================================================== |
--- ipc/ipc_channel_proxy.cc (revision 130443) |
+++ ipc/ipc_channel_proxy.cc (working copy) |
@@ -66,8 +66,8 @@ |
: listener_message_loop_(base::MessageLoopProxy::current()), |
listener_(listener), |
ipc_message_loop_(ipc_message_loop), |
- peer_pid_(0), |
- channel_connected_called_(false) { |
+ channel_connected_called_(false), |
+ peer_pid_(base::kNullProcessId) { |
} |
ChannelProxy::Context::~Context() { |
@@ -126,7 +126,8 @@ |
// the filter is run on the IO thread. |
OnAddFilter(); |
- peer_pid_ = peer_pid; |
+ // We cache off the peer_pid so it can be safely accessed from both threads. |
+ peer_pid_ = channel_->peer_pid(); |
for (size_t i = 0; i < filters_.size(); ++i) |
filters_[i]->OnChannelConnected(peer_pid); |