Mac: Fix performance issues with remote CoreAnimation
[chromium-blink-merge.git] / content / renderer / renderer_main_platform_delegate_android.cc
blob3cafcca7151c5b7f1a4bcf54a14778505a0b85f0
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/renderer/renderer_main_platform_delegate.h"
7 #include "base/command_line.h"
8 #include "base/logging.h"
9 #include "content/public/common/content_switches.h"
11 #ifdef USE_SECCOMP_BPF
12 #include "content/common/sandbox_linux/android/sandbox_bpf_base_policy_android.h"
13 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h"
14 #endif
16 namespace content {
18 RendererMainPlatformDelegate::RendererMainPlatformDelegate(
19 const MainFunctionParams& parameters)
20 : parameters_(parameters) {
23 RendererMainPlatformDelegate::~RendererMainPlatformDelegate() {
26 void RendererMainPlatformDelegate::PlatformInitialize() {
29 void RendererMainPlatformDelegate::PlatformUninitialize() {
32 bool RendererMainPlatformDelegate::EnableSandbox() {
33 #ifdef USE_SECCOMP_BPF
34 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
35 switches::kEnableSeccompFilterSandbox)) {
36 return true;
39 sandbox::SandboxBPF sandbox;
40 sandbox.SetSandboxPolicy(new SandboxBPFBasePolicyAndroid());
41 CHECK(
42 sandbox.StartSandbox(sandbox::SandboxBPF::SeccompLevel::MULTI_THREADED));
43 #endif
44 return true;
47 } // namespace content