summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_channel_proxy.cc
diff options
context:
space:
mode:
authorjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-05 02:38:34 +0000
committerjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-05 02:38:34 +0000
commit0a6fc4bea99fb5d77721bc5bd2ffa467f8d4c5d5 (patch)
treed3c63a4a3730879856cb91c1d7234398ef18b27e /ipc/ipc_channel_proxy.cc
parent20c4975cc82624ccf560668b21e7e33b29c71907 (diff)
downloadchromium_src-0a6fc4bea99fb5d77721bc5bd2ffa467f8d4c5d5.zip
chromium_src-0a6fc4bea99fb5d77721bc5bd2ffa467f8d4c5d5.tar.gz
chromium_src-0a6fc4bea99fb5d77721bc5bd2ffa467f8d4c5d5.tar.bz2
Make IPC channels track their peer process ID
BrokerDuplicateHandle() requires the target process ID on Windows. Rather than plumb this into every channel class independently, I'm adding it at the top. TEST=IPCSyncChannelTest.Verified Review URL: http://codereview.chromium.org/9968111 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130817 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_channel_proxy.cc')
-rw-r--r--ipc/ipc_channel_proxy.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index 2e8c9b3..ce0d595 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -66,8 +66,8 @@ ChannelProxy::Context::Context(Channel::Listener* listener,
: 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 @@ void ChannelProxy::Context::OnChannelConnected(int32 peer_pid) {
// 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);