diff options
author | mdempsky@chromium.org <mdempsky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-10 04:50:11 +0000 |
---|---|---|
committer | mdempsky@chromium.org <mdempsky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-10 04:50:11 +0000 |
commit | 58a487b75e6848cfadfa49be00196f71e2531726 (patch) | |
tree | c7b9375bd90c6be1215c22f8738772dedc72f781 | |
parent | cd07707097bf84900aa0d5861b4b4a5515d3a6d4 (diff) | |
download | chromium_src-58a487b75e6848cfadfa49be00196f71e2531726.zip chromium_src-58a487b75e6848cfadfa49be00196f71e2531726.tar.gz chromium_src-58a487b75e6848cfadfa49be00196f71e2531726.tar.bz2 |
Remove SandboxIPCProcess's dependency on chrome-sandbox
Now that we use RecvMsgWithPid to find the PIDs for zygote children,
we no longer need to plumb the chrome-sandbox path down into and
through the renderer host code.
BUG=357670
NOTRY=true
Review URL: https://codereview.chromium.org/276763002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269530 0039d316-1c4b-4281-b951-d872f2087c98
6 files changed, 7 insertions, 59 deletions
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index 39a1de3..b9443601 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc @@ -164,7 +164,7 @@ void SetupSandbox(const CommandLine& parsed_command_line) { } // Tickle the sandbox host and zygote host so they fork now. - RenderSandboxHostLinux::GetInstance()->Init(sandbox_binary.value()); + RenderSandboxHostLinux::GetInstance()->Init(); ZygoteHostImpl::GetInstance()->Init(sandbox_binary.value()); } #endif diff --git a/content/browser/renderer_host/render_sandbox_host_linux.cc b/content/browser/renderer_host/render_sandbox_host_linux.cc index 02b5fee..846ec26 100644 --- a/content/browser/renderer_host/render_sandbox_host_linux.cc +++ b/content/browser/renderer_host/render_sandbox_host_linux.cc @@ -25,7 +25,7 @@ RenderSandboxHostLinux* RenderSandboxHostLinux::GetInstance() { return Singleton<RenderSandboxHostLinux>::get(); } -void RenderSandboxHostLinux::Init(const std::string& sandbox_path) { +void RenderSandboxHostLinux::Init() { DCHECK(!initialized_); initialized_ = true; @@ -64,7 +64,7 @@ void RenderSandboxHostLinux::Init(const std::string& sandbox_path) { if (IGNORE_EINTR(close(pipefds[1])) < 0) DPLOG(ERROR) << "close"; - SandboxIPCProcess handler(child_lifeline_fd, browser_socket, sandbox_path); + SandboxIPCProcess handler(child_lifeline_fd, browser_socket); handler.Run(); _exit(0); } diff --git a/content/browser/renderer_host/render_sandbox_host_linux.h b/content/browser/renderer_host/render_sandbox_host_linux.h index 2c5df38..2119002 100644 --- a/content/browser/renderer_host/render_sandbox_host_linux.h +++ b/content/browser/renderer_host/render_sandbox_host_linux.h @@ -31,7 +31,7 @@ class CONTENT_EXPORT RenderSandboxHostLinux { DCHECK(initialized_); return pid_; } - void Init(const std::string& sandbox_path); + void Init(); private: friend struct DefaultSingletonTraits<RenderSandboxHostLinux>; diff --git a/content/browser/renderer_host/sandbox_ipc_linux.cc b/content/browser/renderer_host/sandbox_ipc_linux.cc index f988ae9..f156e30 100644 --- a/content/browser/renderer_host/sandbox_ipc_linux.cc +++ b/content/browser/renderer_host/sandbox_ipc_linux.cc @@ -129,15 +129,8 @@ static void MSCharSetToFontconfig(FcLangSet* langset, unsigned fdwCharSet) { namespace content { -SandboxIPCProcess::SandboxIPCProcess(int lifeline_fd, - int browser_socket, - std::string sandbox_cmd) +SandboxIPCProcess::SandboxIPCProcess(int lifeline_fd, int browser_socket) : lifeline_fd_(lifeline_fd), browser_socket_(browser_socket) { - if (!sandbox_cmd.empty()) { - sandbox_cmd_.push_back(sandbox_cmd); - sandbox_cmd_.push_back(base::kFindInodeSwitch); - } - // FontConfig doesn't provide a standard property to control subpixel // positioning, so we pass the current setting through to WebKit. WebFontInfo::setSubpixelPositioning( @@ -220,8 +213,6 @@ void SandboxIPCProcess::HandleRequestFromRenderer(int fd) { HandleGetFontFamilyForChar(fd, pickle, iter, fds.get()); } else if (kind == LinuxSandbox::METHOD_LOCALTIME) { HandleLocaltime(fd, pickle, iter, fds.get()); - } else if (kind == LinuxSandbox::METHOD_GET_CHILD_WITH_INODE) { - HandleGetChildWithInode(fd, pickle, iter, fds.get()); } else if (kind == LinuxSandbox::METHOD_GET_STYLE_FOR_STRIKE) { HandleGetStyleForStrike(fd, pickle, iter, fds.get()); } else if (kind == LinuxSandbox::METHOD_MAKE_SHARED_MEMORY_SEGMENT) { @@ -403,41 +394,6 @@ void SandboxIPCProcess::HandleLocaltime( SendRendererReply(fds, reply, -1); } -void SandboxIPCProcess::HandleGetChildWithInode( - int fd, - const Pickle& pickle, - PickleIterator iter, - const std::vector<base::ScopedFD*>& fds) { - // The other side of this call is in zygote_main_linux.cc - if (sandbox_cmd_.empty()) { - LOG(ERROR) << "Not in the sandbox, this should not be called"; - return; - } - - uint64_t inode; - if (!pickle.ReadUInt64(&iter, &inode)) - return; - - base::ProcessId pid = 0; - std::string inode_output; - - std::vector<std::string> sandbox_cmd = sandbox_cmd_; - sandbox_cmd.push_back(base::Int64ToString(inode)); - CommandLine get_inode_cmd(sandbox_cmd); - if (base::GetAppOutput(get_inode_cmd, &inode_output)) - base::StringToInt(inode_output, &pid); - - if (!pid) { - // Even though the pid is invalid, we still need to reply to the zygote - // and not just return here. - LOG(ERROR) << "Could not get pid"; - } - - Pickle reply; - reply.WriteInt(pid); - SendRendererReply(fds, reply, -1); -} - void SandboxIPCProcess::HandleMakeSharedMemorySegment( int fd, const Pickle& pickle, diff --git a/content/browser/renderer_host/sandbox_ipc_linux.h b/content/browser/renderer_host/sandbox_ipc_linux.h index e900954..6b4bcee 100644 --- a/content/browser/renderer_host/sandbox_ipc_linux.h +++ b/content/browser/renderer_host/sandbox_ipc_linux.h @@ -26,9 +26,7 @@ class SandboxIPCProcess { // point of view of the renderer, it's talking to the browser but this // object actually services the requests. // sandbox_cmd: the path of the sandbox executable. - SandboxIPCProcess(int lifeline_fd, - int browser_socket, - std::string sandbox_cmd); + SandboxIPCProcess(int lifeline_fd, int browser_socket); ~SandboxIPCProcess(); void Run(); @@ -65,11 +63,6 @@ class SandboxIPCProcess { PickleIterator iter, const std::vector<base::ScopedFD*>& fds); - void HandleGetChildWithInode(int fd, - const Pickle& pickle, - PickleIterator iter, - const std::vector<base::ScopedFD*>& fds); - void HandleMakeSharedMemorySegment(int fd, const Pickle& pickle, PickleIterator iter, @@ -86,7 +79,6 @@ class SandboxIPCProcess { const int lifeline_fd_; const int browser_socket_; - std::vector<std::string> sandbox_cmd_; scoped_ptr<BlinkPlatformImpl> webkit_platform_support_; SkTDArray<SkString*> paths_; diff --git a/content/common/sandbox_linux/sandbox_linux.h b/content/common/sandbox_linux/sandbox_linux.h index 235ba96..4f0a680 100644 --- a/content/common/sandbox_linux/sandbox_linux.h +++ b/content/common/sandbox_linux/sandbox_linux.h @@ -30,7 +30,7 @@ class LinuxSandbox { enum LinuxSandboxIPCMethods { METHOD_GET_FONT_FAMILY_FOR_CHAR = 32, METHOD_LOCALTIME = 33, - METHOD_GET_CHILD_WITH_INODE = 34, + DEPRECATED_METHOD_GET_CHILD_WITH_INODE = 34, METHOD_GET_STYLE_FOR_STRIKE = 35, METHOD_MAKE_SHARED_MEMORY_SEGMENT = 36, METHOD_MATCH_WITH_FALLBACK = 37, |