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 #ifndef SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_POLICY_H_ | 5 #ifndef CONTENT_COMMON_SANDBOX_LINUX_SANDBOX_BPF_CROS_ARM_GPU_POLICY_LINUX_H_ |
6 #define SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_POLICY_H_ | 6 #define CONTENT_COMMON_SANDBOX_LINUX_SANDBOX_BPF_CROS_ARM_GPU_POLICY_LINUX_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "content/common/sandbox_linux/sandbox_bpf_gpu_policy_linux.h" |
9 | 9 |
10 namespace sandbox { | 10 namespace content { |
11 | 11 |
12 class ErrorCode; | 12 // This policy is for Chrome OS ARM. |
13 class SandboxBPF; | 13 class CrosArmGpuProcessPolicy : public GpuProcessPolicy { |
14 public: | |
15 explicit CrosArmGpuProcessPolicy(bool allow_shmat) | |
Robert Sesek
2013/12/12 21:33:48
Don't inline ctors and dtors:
http://dev.chromium.
jln (very slow on Chromium)
2013/12/12 22:15:14
Done.
| |
16 : allow_shmat_(allow_shmat) {} | |
17 virtual ~CrosArmGpuProcessPolicy() {} | |
14 | 18 |
15 // This is the interface to implement to define a BPF sandbox policy. | |
16 class SandboxBPFPolicy { | |
17 public: | |
18 SandboxBPFPolicy() {} | |
19 virtual ~SandboxBPFPolicy() {} | |
20 | |
21 // The EvaluateSyscall method is called with the system call number. It can | |
22 // decide to allow the system call unconditionally by returning ERR_ALLOWED; | |
23 // it can deny the system call unconditionally by returning an appropriate | |
24 // "errno" value; or it can request inspection of system call argument(s) by | |
25 // returning a suitable ErrorCode. | |
26 virtual ErrorCode EvaluateSyscall(SandboxBPF* sandbox_compiler, | 19 virtual ErrorCode EvaluateSyscall(SandboxBPF* sandbox_compiler, |
27 int system_call_number) const = 0; | 20 int system_call_number) const OVERRIDE; |
21 virtual bool PreSandboxHook() OVERRIDE; | |
28 | 22 |
29 private: | 23 private: |
30 DISALLOW_COPY_AND_ASSIGN(SandboxBPFPolicy); | 24 const bool allow_shmat_; // Allow shmat(2). |
25 DISALLOW_COPY_AND_ASSIGN(CrosArmGpuProcessPolicy); | |
31 }; | 26 }; |
32 | 27 |
33 } // namespace sandbox | 28 } // namespace content |
34 | 29 |
35 #endif // SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_POLICY_H_ | 30 #endif |
31 // CONTENT_COMMON_SANDBOX_LINUX_SANDBOX_BPF_CROS_ARM_GPU_POLICY_LINUX_H_ | |
Robert Sesek
2013/12/12 21:33:48
nit: put on previous line, even if it overflows 80
jln (very slow on Chromium)
2013/12/12 22:15:14
Done.
| |
OLD | NEW |