summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_channel_posix.h
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_posix.h
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_posix.h')
-rw-r--r--ipc/ipc_channel_posix.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/ipc/ipc_channel_posix.h b/ipc/ipc_channel_posix.h
index 028e5d9..cb7eb84 100644
--- a/ipc/ipc_channel_posix.h
+++ b/ipc/ipc_channel_posix.h
@@ -15,6 +15,7 @@
#include <vector>
#include "base/message_loop.h"
+#include "base/process.h"
#include "ipc/file_descriptor_set_posix.h"
#include "ipc/ipc_channel_reader.h"
@@ -65,6 +66,7 @@ class Channel::ChannelImpl : public internal::ChannelReader,
bool HasAcceptedConnection() const;
bool GetClientEuid(uid_t* client_euid) const;
void ResetToAcceptingConnectionState();
+ base::ProcessId peer_pid() const { return peer_pid_; }
static bool IsNamedServerInitialized(const std::string& channel_id);
#if defined(OS_LINUX)
static void SetGlobalPid(int pid);
@@ -113,6 +115,8 @@ class Channel::ChannelImpl : public internal::ChannelReader,
Mode mode_;
+ base::ProcessId peer_pid_;
+
// After accepting one client connection on our server socket we want to
// stop listening.
MessageLoopForIO::FileDescriptorWatcher server_listen_connection_watcher_;