#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "content/common/zygote/zygote_communication_linux.h"
#include <string.h>
#include <sys/socket.h>
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/files/platform_file.h"
#include "base/i18n/unicodestring.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/numerics/safe_conversions.h"
#include "base/path_service.h"
#include "base/pickle.h"
#include "base/posix/eintr_wrapper.h"
#include "base/posix/unix_domain_socket.h"
#include "content/common/zygote/zygote_commands_linux.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/result_codes.h"
#include "sandbox/policy/switches.h"
#include "third_party/icu/source/i18n/unicode/timezone.h"
namespace content {
ZygoteCommunication::ZygoteCommunication(ZygoteType type)
: … { … }
ZygoteCommunication::~ZygoteCommunication() { … }
bool ZygoteCommunication::SendMessage(const base::Pickle& data,
const std::vector<int>* fds) { … }
ssize_t ZygoteCommunication::ReadSandboxStatus() { … }
ssize_t ZygoteCommunication::ReadReply(void* buf, size_t buf_len) { … }
void ZygoteCommunication::ReinitializeLogging(
uint32_t logging_dest,
base::PlatformFile raw_log_file_fd) { … }
pid_t ZygoteCommunication::ForkRequest(
const std::vector<std::string>& argv,
const base::FileHandleMappingVector& mapping,
const std::string& process_type) { … }
void ZygoteCommunication::EnsureProcessTerminated(pid_t process) { … }
void ZygoteCommunication::ZygoteChildBorn(pid_t process) { … }
void ZygoteCommunication::ZygoteChildDied(pid_t process) { … }
void ZygoteCommunication::Init(
base::OnceCallback<pid_t(base::CommandLine*, base::ScopedFD*)> launcher) { … }
base::TerminationStatus ZygoteCommunication::GetTerminationStatus(
base::ProcessHandle handle,
bool known_dead,
int* exit_code) { … }
int ZygoteCommunication::GetSandboxStatus() { … }
}