summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_channel_posix.h
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-19 18:05:11 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-19 18:05:11 +0000
commit29c5d23eeb86edb8a1ca8a97fb56b0a2e698b759 (patch)
treebf9fe5f567e6fe59eeb8ee980b39dbb258e106ce /ipc/ipc_channel_posix.h
parent1c0e5732ac1faa5bf69dcd2cae5e91ac52b3fbf0 (diff)
downloadchromium_src-29c5d23eeb86edb8a1ca8a97fb56b0a2e698b759.zip
chromium_src-29c5d23eeb86edb8a1ca8a97fb56b0a2e698b759.tar.gz
chromium_src-29c5d23eeb86edb8a1ca8a97fb56b0a2e698b759.tar.bz2
Fix IPC OnChannelConnected() to send correct PID on Linux/CrOS
Sandboxed renderers on Linux/CrOS are in a PID namespace, so they don't know their own global PID. Thus the PID sent in the IPC channel Hello message contains an unexpected value, which is used in the OnChannelConnected() callback into chrome. This causes problems like the Task Manager not showing any data for FPS, JavaScript memory and image cache memory. The task manager is attempting to use the PID/process handle from BrowserMessageFilter, which got it from IPC::Channel::Listener::OnChannelConnected(), and it doesn't match the global PID of each renderer. BUG=70179 TEST=manual, open a few tabs, then open task manager, right-click to turn on JavaScript memory and image memory. Verify there are non-zero values for FPS, JavaScript memory, image cache memory Review URL: http://codereview.chromium.org/7661004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97481 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_channel_posix.h')
-rw-r--r--ipc/ipc_channel_posix.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/ipc/ipc_channel_posix.h b/ipc/ipc_channel_posix.h
index b66b1fc..c1aaa2b 100644
--- a/ipc/ipc_channel_posix.h
+++ b/ipc/ipc_channel_posix.h
@@ -62,6 +62,10 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher {
bool HasAcceptedConnection() const;
bool GetClientEuid(uid_t* client_euid) const;
void ResetToAcceptingConnectionState();
+#if defined(OS_LINUX)
+ void SetNeedsOverridePeerPid();
+ void OverridePeerPid(int32 peer_pid);
+#endif // defined(OS_LINUX)
static bool IsNamedServerInitialized(const std::string& channel_id);
private:
@@ -147,6 +151,10 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher {
// True if we are responsible for unlinking the unix domain socket file.
bool must_unlink_;
+ // See IPC::Channel::SetNeedsOverridePeerPid() header comment for details.
+ bool needs_override_peer_pid_;
+ int32 override_peer_pid_;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelImpl);
};