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-31 21:11:04 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-31 21:11:04 +0000
commite1d67a8826a4a19e370b8f9f18b45bff4d4de163 (patch)
tree986b2ec88dc7a312435bb307e648daeac401a648 /ipc/ipc_channel_posix.h
parent943b86100cc75e6fbccdf82aeca23cce9aa66508 (diff)
downloadchromium_src-e1d67a8826a4a19e370b8f9f18b45bff4d4de163.zip
chromium_src-e1d67a8826a4a19e370b8f9f18b45bff4d4de163.tar.gz
chromium_src-e1d67a8826a4a19e370b8f9f18b45bff4d4de163.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/7778031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99040 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_channel_posix.h')
-rw-r--r--ipc/ipc_channel_posix.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ipc/ipc_channel_posix.h b/ipc/ipc_channel_posix.h
index b66b1fc..399d282 100644
--- a/ipc/ipc_channel_posix.h
+++ b/ipc/ipc_channel_posix.h
@@ -63,6 +63,9 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher {
bool GetClientEuid(uid_t* client_euid) const;
void ResetToAcceptingConnectionState();
static bool IsNamedServerInitialized(const std::string& channel_id);
+#if defined(OS_LINUX)
+ static void SetGlobalPid(int pid);
+#endif // OS_LINUX
private:
bool CreatePipe(const IPC::ChannelHandle& channel_handle);
@@ -72,6 +75,7 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher {
bool AcceptConnection();
void ClosePipeOnError();
+ int GetHelloMessageProcId();
void QueueHelloMessage();
bool IsHelloMessage(const Message* m) const;
@@ -147,6 +151,11 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher {
// True if we are responsible for unlinking the unix domain socket file.
bool must_unlink_;
+#if defined(OS_LINUX)
+ // If non-zero, overrides the process ID sent in the hello message.
+ static int global_pid_;
+#endif // OS_LINUX
+
DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelImpl);
};