| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/public/common/sandbox_init.h" | 5 #include "content/public/common/sandbox_init.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/files/scoped_file.h" | 9 #include "base/files/scoped_file.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "content/common/sandbox_linux/sandbox_seccomp_bpf_linux.h" | 12 #include "content/common/sandbox_linux/sandbox_seccomp_bpf_linux.h" |
| 13 #include "sandbox/linux/bpf_dsl/policy.h" | 13 #include "sandbox/linux/bpf_dsl/policy.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 bool InitializeSandbox(scoped_ptr<sandbox::bpf_dsl::Policy> policy, | 17 bool InitializeSandbox(scoped_ptr<sandbox::bpf_dsl::Policy> policy, |
| 18 base::ScopedFD proc_fd) { | 18 base::ScopedFD proc_fd) { |
| 19 return SandboxSeccompBPF::StartSandboxWithExternalPolicy(policy.Pass(), | 19 return SandboxSeccompBPF::StartSandboxWithExternalPolicy(std::move(policy), |
| 20 std::move(proc_fd)); | 20 std::move(proc_fd)); |
| 21 } | 21 } |
| 22 | 22 |
| 23 #if !defined(OS_NACL_NONSFI) | 23 #if !defined(OS_NACL_NONSFI) |
| 24 scoped_ptr<sandbox::bpf_dsl::Policy> GetBPFSandboxBaselinePolicy() { | 24 scoped_ptr<sandbox::bpf_dsl::Policy> GetBPFSandboxBaselinePolicy() { |
| 25 return SandboxSeccompBPF::GetBaselinePolicy().Pass(); | 25 return SandboxSeccompBPF::GetBaselinePolicy(); |
| 26 } | 26 } |
| 27 #endif // !defined(OS_NACL_NONSFI) | 27 #endif // !defined(OS_NACL_NONSFI) |
| 28 | 28 |
| 29 } // namespace content | 29 } // namespace content |
| OLD | NEW |