summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/render_sandbox_host_linux.h
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 08:32:22 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 08:32:22 +0000
commit8ecd3aade85b825c8206735f16c23880023782db (patch)
tree5ca73cd7ff58f4f7b640fc5e5d95da0729649f36 /chrome/browser/renderer_host/render_sandbox_host_linux.h
parentedd64ac1dd45bc249dea061c4c2d4d6057d4dac8 (diff)
downloadchromium_src-8ecd3aade85b825c8206735f16c23880023782db.zip
chromium_src-8ecd3aade85b825c8206735f16c23880023782db.tar.gz
chromium_src-8ecd3aade85b825c8206735f16c23880023782db.tar.bz2
Add support for getting the real process id from within the suid sandbox. The browser processes gets the real process ids, so they look correct in the task manager. When it asks the zygote to reap a process, we use the process ids internal to the sandbox.
While we are at it, reap the sandbox process after it clones the zygote and figure out zygote's actual process id. Save the actual process id rather than that of the sandbox. Original review: http://codereview.chromium.org/262020 This is try 2 - initialize the sandbox host and zygote for InProcessBrowserTest. TBR=agl BUG=20012, 20714, 23072 TEST=Process IDs for renderers should be correct in the task manager and you should be able to use the end process button to kill them. Review URL: http://codereview.chromium.org/361002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30948 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/render_sandbox_host_linux.h')
-rw-r--r--chrome/browser/renderer_host/render_sandbox_host_linux.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/chrome/browser/renderer_host/render_sandbox_host_linux.h b/chrome/browser/renderer_host/render_sandbox_host_linux.h
index 6911787..ef871b8 100644
--- a/chrome/browser/renderer_host/render_sandbox_host_linux.h
+++ b/chrome/browser/renderer_host/render_sandbox_host_linux.h
@@ -7,6 +7,9 @@
#ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_
#define CHROME_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_
+#include <string>
+
+#include "base/logging.h"
#include "base/singleton.h"
// This is a singleton object which handles sandbox requests from the
@@ -15,8 +18,15 @@ class RenderSandboxHostLinux {
public:
// Get the file descriptor which renderers should be given in order to signal
// crashes to the browser.
- int GetRendererSocket() const { return renderer_socket_; }
- pid_t pid() const { return pid_; }
+ int GetRendererSocket() const {
+ DCHECK(init_);
+ return renderer_socket_;
+ }
+ pid_t pid() const {
+ DCHECK(init_);
+ return pid_;
+ }
+ void Init(const std::string& sandbox_path);
private:
friend struct DefaultSingletonTraits<RenderSandboxHostLinux>;
@@ -24,11 +34,12 @@ class RenderSandboxHostLinux {
RenderSandboxHostLinux();
~RenderSandboxHostLinux();
+ bool init_;
int renderer_socket_;
int childs_lifeline_fd_;
pid_t pid_;
- DISALLOW_EVIL_CONSTRUCTORS(RenderSandboxHostLinux);
+ DISALLOW_COPY_AND_ASSIGN(RenderSandboxHostLinux);
};
#endif // CHROME_BROWSER_RENDERER_HOST_RENDER_SANDBOX_HOST_LINUX_H_