summaryrefslogtreecommitdiffstats
path: root/chrome/browser/zygote_main_linux.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/zygote_main_linux.cc')
-rw-r--r--chrome/browser/zygote_main_linux.cc30
1 files changed, 14 insertions, 16 deletions
diff --git a/chrome/browser/zygote_main_linux.cc b/chrome/browser/zygote_main_linux.cc
index 1b26a6b..c0ba88c 100644
--- a/chrome/browser/zygote_main_linux.cc
+++ b/chrome/browser/zygote_main_linux.cc
@@ -32,24 +32,20 @@
#include "base/rand_util.h"
#include "base/scoped_ptr.h"
#include "base/sys_info.h"
-#include "base/unix_domain_socket_posix.h"
#include "build/build_config.h"
-
#include "chrome/browser/zygote_host_linux.h"
#include "chrome/common/chrome_descriptors.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/font_config_ipc_linux.h"
#include "chrome/common/main_function_params.h"
#include "chrome/common/pepper_plugin_registry.h"
#include "chrome/common/process_watcher.h"
#include "chrome/common/result_codes.h"
#include "chrome/common/sandbox_methods_linux.h"
-
+#include "chrome/common/unix_domain_socket_posix.h"
#include "media/base/media.h"
-
-#include "skia/ext/SkFontHost_fontconfig_control.h"
-
#include "seccompsandbox/sandbox.h"
-
+#include "skia/ext/SkFontHost_fontconfig_control.h"
#include "unicode/timezone.h"
#if defined(ARCH_CPU_X86_FAMILY) && !defined(CHROMIUM_SELINUX) && \
@@ -116,8 +112,8 @@ class Zygote {
// Let the ZygoteHost know we are ready to go.
// The receiving code is in chrome/browser/zygote_host_linux.cc.
std::vector<int> empty;
- bool r = base::SendMsg(kBrowserDescriptor, kZygoteMagic,
- sizeof(kZygoteMagic), empty);
+ bool r = UnixDomainSocket::SendMsg(kBrowserDescriptor, kZygoteMagic,
+ sizeof(kZygoteMagic), empty);
CHECK(r) << "Sending zygote magic failed";
}
@@ -141,7 +137,7 @@ class Zygote {
std::vector<int> fds;
static const unsigned kMaxMessageLength = 1024;
char buf[kMaxMessageLength];
- const ssize_t len = base::RecvMsg(fd, buf, sizeof(buf), &fds);
+ const ssize_t len = UnixDomainSocket::RecvMsg(fd, buf, sizeof(buf), &fds);
if (len == 0 || (len == -1 && errno == ECONNRESET)) {
// EOF from the browser. We should die.
@@ -297,9 +293,9 @@ class Zygote {
request.WriteInt(LinuxSandbox::METHOD_GET_CHILD_WITH_INODE);
request.WriteUInt64(dummy_inode);
- const ssize_t r = base::SendRecvMsg(kMagicSandboxIPCDescriptor,
- reply_buf, sizeof(reply_buf),
- NULL, request);
+ const ssize_t r = UnixDomainSocket::SendRecvMsg(
+ kMagicSandboxIPCDescriptor, reply_buf, sizeof(reply_buf), NULL,
+ request);
if (r == -1) {
LOG(ERROR) << "Failed to get child process's real PID";
goto error;
@@ -453,7 +449,7 @@ static void ProxyLocaltimeCallToBrowser(time_t input, struct tm* output,
std::string(reinterpret_cast<char*>(&input), sizeof(input)));
uint8_t reply_buf[512];
- const ssize_t r = base::SendRecvMsg(
+ const ssize_t r = UnixDomainSocket::SendRecvMsg(
kMagicSandboxIPCDescriptor, reply_buf, sizeof(reply_buf), NULL, request);
if (r == -1) {
memset(output, 0, sizeof(struct tm));
@@ -649,7 +645,8 @@ static bool EnterSandbox() {
return false;
}
- SkiaFontConfigUseIPCImplementation(kMagicSandboxIPCDescriptor);
+ SkiaFontConfigSetImplementation(
+ new FontConfigIPC(kMagicSandboxIPCDescriptor));
// Previously, we required that the binary be non-readable. This causes the
// kernel to mark the process as non-dumpable at startup. The thinking was
@@ -678,7 +675,8 @@ static bool EnterSandbox() {
}
} else if (switches::SeccompSandboxEnabled()) {
PreSandboxInit();
- SkiaFontConfigUseIPCImplementation(kMagicSandboxIPCDescriptor);
+ SkiaFontConfigSetImplementation(
+ new FontConfigIPC(kMagicSandboxIPCDescriptor));
} else {
SkiaFontConfigUseDirectImplementation();
}