Index: content/browser/renderer_host/render_sandbox_host_linux.cc |
diff --git a/content/browser/renderer_host/render_sandbox_host_linux.cc b/content/browser/renderer_host/render_sandbox_host_linux.cc |
index 0314ce1846836a3f1bf556faead40ad568861d48..10f3fea0b6b2ab2e074619fa1f61eb431d014bed 100644 |
--- a/content/browser/renderer_host/render_sandbox_host_linux.cc |
+++ b/content/browser/renderer_host/render_sandbox_host_linux.cc |
@@ -8,16 +8,12 @@ |
#include "base/memory/singleton.h" |
#include "base/posix/eintr_wrapper.h" |
-#include "content/browser/renderer_host/sandbox_ipc_linux.h" |
namespace content { |
// Runs on the main thread at startup. |
RenderSandboxHostLinux::RenderSandboxHostLinux() |
- : initialized_(false), |
- renderer_socket_(0), |
- childs_lifeline_fd_(0), |
- pid_(0) { |
+ : initialized_(false), renderer_socket_(0), childs_lifeline_fd_(0) { |
} |
// static |
@@ -53,21 +49,11 @@ void RenderSandboxHostLinux::Init() { |
const int child_lifeline_fd = pipefds[0]; |
childs_lifeline_fd_ = pipefds[1]; |
- // We need to be monothreaded before we fork(). |
-#if !defined(THREAD_SANITIZER) |
- DCHECK_EQ(1, base::GetNumberOfThreads(base::GetCurrentProcessHandle())); |
-#endif // !defined(THREAD_SANITIZER) |
- pid_ = fork(); |
- if (pid_ == 0) { |
- if (IGNORE_EINTR(close(fds[0])) < 0) |
- DPLOG(ERROR) << "close"; |
- if (IGNORE_EINTR(close(pipefds[1])) < 0) |
- DPLOG(ERROR) << "close"; |
- |
- SandboxIPCProcess handler(child_lifeline_fd, browser_socket); |
- handler.Run(); |
- _exit(0); |
- } |
+ ipc_handler_.reset( |
+ new SandboxIPCHandler(child_lifeline_fd, browser_socket)); |
+ ipc_thread_.reset( |
+ new base::DelegateSimpleThread(ipc_handler_.get(), "sandbox_ipc_thread")); |
+ ipc_thread_->Start(); |
} |
bool RenderSandboxHostLinux::ShutdownIPCChannel() { |
@@ -80,6 +66,8 @@ RenderSandboxHostLinux::~RenderSandboxHostLinux() { |
LOG(ERROR) << "ShutdownIPCChannel failed"; |
if (IGNORE_EINTR(close(renderer_socket_)) < 0) |
PLOG(ERROR) << "close"; |
+ |
+ ipc_thread_->Join(); |
} |
} |