Explicitly add python-numpy dependency to install-build-deps.
[chromium-blink-merge.git] / components / nacl / loader / nonsfi / nonsfi_sandbox.h
blob2441ff3933f5f8196416c2304844db9cf92123e0
1 // Copyright 2014 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 #ifndef COMPONENTS_NACL_LOADER_NONSFI_NONSFI_SANDBOX_H_
6 #define COMPONENTS_NACL_LOADER_NONSFI_NONSFI_SANDBOX_H_
8 #include "base/basictypes.h"
9 #include "sandbox/linux/bpf_dsl/bpf_dsl_forward.h"
10 #include "sandbox/linux/bpf_dsl/policy.h"
12 namespace nacl {
13 namespace nonsfi {
15 // The seccomp sandbox policy for NaCl non-SFI mode. Note that this
16 // policy must be as strong as possible, as non-SFI mode heavily
17 // depends on seccomp sandbox.
18 class NaClNonSfiBPFSandboxPolicy : public sandbox::bpf_dsl::Policy {
19 public:
20 explicit NaClNonSfiBPFSandboxPolicy() {}
21 ~NaClNonSfiBPFSandboxPolicy() override {}
23 sandbox::bpf_dsl::ResultExpr EvaluateSyscall(int sysno) const override;
24 sandbox::bpf_dsl::ResultExpr InvalidSyscall() const override;
26 private:
27 DISALLOW_COPY_AND_ASSIGN(NaClNonSfiBPFSandboxPolicy);
30 // Initializes seccomp-bpf sandbox for non-SFI NaCl. Returns false on
31 // failure.
32 bool InitializeBPFSandbox();
34 } // namespace nonsfi
35 } // namespace nacl
37 #endif // COMPONENTS_NACL_LOADER_NONSFI_NONSFI_SANDBOX_H_