#ifndef CONTENT_BROWSER_SANDBOX_HOST_LINUX_H_
#define CONTENT_BROWSER_SANDBOX_HOST_LINUX_H_
#include <memory>
#include "base/check.h"
#include "base/no_destructor.h"
#include "base/threading/simple_thread.h"
#include "content/browser/sandbox_ipc_linux.h"
namespace content {
class SandboxHostLinux {
public:
static SandboxHostLinux* GetInstance();
SandboxHostLinux(const SandboxHostLinux&) = delete;
SandboxHostLinux& operator=(const SandboxHostLinux&) = delete;
int GetChildSocket() const {
DCHECK(initialized_);
return child_socket_;
}
void Init();
bool IsInitialized() const { return initialized_; }
private:
friend class base::NoDestructor<SandboxHostLinux>;
SandboxHostLinux();
~SandboxHostLinux() = delete;
bool initialized_ = false;
int child_socket_ = 0;
int childs_lifeline_fd_ = 0;
std::unique_ptr<SandboxIPCHandler> ipc_handler_;
std::unique_ptr<base::DelegateSimpleThread> ipc_thread_;
};
}
#endif