Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(854)

Unified Diff: ipc/ipc_channel_proxy.h

Issue 9968111: Make IPC channels track their peer process ID (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/ipc_channel_posix.cc ('k') | ipc/ipc_channel_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_proxy.h
===================================================================
--- ipc/ipc_channel_proxy.h (revision 130443)
+++ ipc/ipc_channel_proxy.h (working copy)
@@ -168,6 +168,10 @@
// Called to clear the pointer to the IPC message loop when it's going away.
void ClearIPCMessageLoop();
+ // Get the process ID for the connected peer.
+ // Returns base::kNullProcessId if the peer is not connected yet.
+ base::ProcessId peer_pid() const { return context_->peer_pid_; }
+
#if defined(OS_POSIX)
// Calls through to the underlying channel's methods.
int GetClientFileDescriptor();
@@ -246,7 +250,6 @@
scoped_refptr<base::MessageLoopProxy> ipc_message_loop_;
scoped_ptr<Channel> channel_;
std::string channel_id_;
- int peer_pid_;
bool channel_connected_called_;
// Holds filters between the AddFilter call on the listerner thread and the
@@ -254,6 +257,10 @@
std::vector<scoped_refptr<MessageFilter> > pending_filters_;
// Lock for pending_filters_.
base::Lock pending_filters_lock_;
+
+ // Cached copy of the peer process ID. Set on IPC but read on both IPC and
+ // listener threads.
+ base::ProcessId peer_pid_;
};
Context* context() { return context_; }
« no previous file with comments | « ipc/ipc_channel_posix.cc ('k') | ipc/ipc_channel_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698