blob: 6467f570a9dca308132199829542382fea757034 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/renderer/renderer_main_platform_delegate.h"
#include "base/command_line.h"
#include "content/common/content_switches.h"
// This #ifdef logic must be kept in sync with zygote_main_linux.cc.
// TODO(evan): this file doesn't do anything anyway, we should delete it.
#if defined(ARCH_CPU_X86_FAMILY) && !defined(CHROMIUM_SELINUX) && \
!defined(__clang__) && !defined(OS_CHROMEOS) && !defined(TOOLKIT_VIEWS)
#define SECCOMP_SANDBOX
#include "seccompsandbox/sandbox.h"
#endif
RendererMainPlatformDelegate::RendererMainPlatformDelegate(
const MainFunctionParams& parameters)
: parameters_(parameters) {
}
RendererMainPlatformDelegate::~RendererMainPlatformDelegate() {
}
void RendererMainPlatformDelegate::PlatformInitialize() {
}
void RendererMainPlatformDelegate::PlatformUninitialize() {
}
bool RendererMainPlatformDelegate::InitSandboxTests(bool no_sandbox) {
// The sandbox is started in the zygote process: zygote_main_linux.cc
// http://code.google.com/p/chromium/wiki/LinuxSUIDSandbox
return true;
}
bool RendererMainPlatformDelegate::EnableSandbox() {
// The setuid sandbox is started in the zygote process: zygote_main_linux.cc
// http://code.google.com/p/chromium/wiki/LinuxSUIDSandbox
//
// The seccomp sandbox is started in the renderer.
// http://code.google.com/p/seccompsandbox/
#if defined(SECCOMP_SANDBOX)
// N.b. SupportsSeccompSandbox() returns a cached result, as we already
// called it earlier in the zygote. Thus, it is OK for us to not pass in
// a file descriptor for "/proc".
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableSeccompSandbox) && SupportsSeccompSandbox(-1))
StartSeccompSandbox();
#endif
return true;
}
void RendererMainPlatformDelegate::RunSandboxTests() {
// The sandbox is started in the zygote process: zygote_main_linux.cc
// http://code.google.com/p/chromium/wiki/LinuxSUIDSandbox
}
|