From 0a6fc4bea99fb5d77721bc5bd2ffa467f8d4c5d5 Mon Sep 17 00:00:00 2001 From: "jschuh@chromium.org" Date: Thu, 5 Apr 2012 02:38:34 +0000 Subject: 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 --- ipc/ipc_sync_channel_unittest.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ipc/ipc_sync_channel_unittest.cc') diff --git a/ipc/ipc_sync_channel_unittest.cc b/ipc/ipc_sync_channel_unittest.cc index 81f5d11..511164a 100644 --- a/ipc/ipc_sync_channel_unittest.cc +++ b/ipc/ipc_sync_channel_unittest.cc @@ -14,6 +14,7 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" +#include "base/process_util.h" #include "base/stl_util.h" #include "base/string_util.h" #include "base/third_party/dynamic_annotations/dynamic_annotations.h" @@ -1768,6 +1769,7 @@ class VerifiedServer : public Worker { VLOG(1) << __FUNCTION__ << " Sending reply: " << reply_text_; SyncChannelNestedTestMsg_String::WriteReplyParams(reply_msg, reply_text_); Send(reply_msg); + ASSERT_EQ(channel()->peer_pid(), base::GetCurrentProcId()); Done(); } @@ -1793,6 +1795,7 @@ class VerifiedClient : public Worker { DCHECK_EQ(response, expected_text_); VLOG(1) << __FUNCTION__ << " Received reply: " << response; + ASSERT_EQ(channel()->peer_pid(), base::GetCurrentProcId()); Done(); } -- cgit v1.1