diff options
Diffstat (limited to 'content/browser')
3 files changed, 13 insertions, 4 deletions
diff --git a/content/browser/renderer_host/render_sandbox_host_linux.cc b/content/browser/renderer_host/render_sandbox_host_linux.cc index 846ec26..0314ce1 100644 --- a/content/browser/renderer_host/render_sandbox_host_linux.cc +++ b/content/browser/renderer_host/render_sandbox_host_linux.cc @@ -70,12 +70,16 @@ void RenderSandboxHostLinux::Init() { } } +bool RenderSandboxHostLinux::ShutdownIPCChannel() { + return IGNORE_EINTR(close(childs_lifeline_fd_)) == 0; +} + RenderSandboxHostLinux::~RenderSandboxHostLinux() { if (initialized_) { + if (!ShutdownIPCChannel()) + LOG(ERROR) << "ShutdownIPCChannel failed"; if (IGNORE_EINTR(close(renderer_socket_)) < 0) PLOG(ERROR) << "close"; - if (IGNORE_EINTR(close(childs_lifeline_fd_)) < 0) - PLOG(ERROR) << "close"; } } diff --git a/content/browser/renderer_host/render_sandbox_host_linux.h b/content/browser/renderer_host/render_sandbox_host_linux.h index 2119002..c056e8de 100644 --- a/content/browser/renderer_host/render_sandbox_host_linux.h +++ b/content/browser/renderer_host/render_sandbox_host_linux.h @@ -39,6 +39,8 @@ class CONTENT_EXPORT RenderSandboxHostLinux { RenderSandboxHostLinux(); ~RenderSandboxHostLinux(); + bool ShutdownIPCChannel(); + // Whether Init() has been called yet. bool initialized_; diff --git a/content/browser/renderer_host/sandbox_ipc_linux.cc b/content/browser/renderer_host/sandbox_ipc_linux.cc index f156e30..7bcccc9 100644 --- a/content/browser/renderer_host/sandbox_ipc_linux.cc +++ b/content/browser/renderer_host/sandbox_ipc_linux.cc @@ -169,15 +169,18 @@ void SandboxIPCProcess::Run() { failed_polls = 0; + // The browser process will close the other end of this pipe on shutdown, + // so we should exit. if (pfds[0].revents) { - // our parent died so we should too. - _exit(0); + break; } if (pfds[1].revents) { HandleRequestFromRenderer(browser_socket_); } } + + VLOG(1) << "SandboxIPCProcess stopping."; } void SandboxIPCProcess::HandleRequestFromRenderer(int fd) { |