OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_COMMON_SANDBOX_SECCOMP_BPF_LINUX_H_ | 5 #ifndef CONTENT_COMMON_SANDBOX_SECCOMP_BPF_LINUX_H_ |
6 #define CONTENT_COMMON_SANDBOX_SECCOMP_BPF_LINUX_H_ | 6 #define CONTENT_COMMON_SANDBOX_SECCOMP_BPF_LINUX_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 | 11 |
12 class SandboxSeccompBpf { | 12 class SandboxSeccompBpf { |
13 public: | 13 public: |
14 // Is the sandbox globally enabled, can anything use it at all ? | 14 // Is the sandbox globally enabled, can anything use it at all ? |
15 // This looks at global command line flags to see if the sandbox | 15 // This looks at global command line flags to see if the sandbox |
16 // should be enabled at all. | 16 // should be enabled at all. |
17 static bool IsSeccompBpfDesired(); | 17 static bool IsSeccompBpfDesired(); |
18 // Should the sandbox be enabled for process_type ? | 18 // Should the sandbox be enabled for process_type ? |
19 static bool ShouldEnableSeccompBpf(const std::string& process_type); | 19 static bool ShouldEnableSeccompBpf( |
| 20 LinuxSandbox::SandboxConfig sandbox_config); |
20 // Check if the kernel supports this sandbox. It's useful to "prewarm" | 21 // Check if the kernel supports this sandbox. It's useful to "prewarm" |
21 // this, part of the result will be cached. | 22 // this, part of the result will be cached. |
22 static bool SupportsSandbox(); | 23 static bool SupportsSandbox(); |
23 // Start the sandbox and apply the policy for process_type, depending on | 24 // Start the sandbox and apply the policy for process_type, depending on |
24 // command line switches. | 25 // command line switches. |
25 static bool StartSandbox(const std::string& process_type); | 26 static bool StartSandbox(LinuxSandbox::SandboxConfig sandbox_config); |
26 | 27 |
27 private: | 28 private: |
28 DISALLOW_IMPLICIT_CONSTRUCTORS(SandboxSeccompBpf); | 29 DISALLOW_IMPLICIT_CONSTRUCTORS(SandboxSeccompBpf); |
29 }; | 30 }; |
30 | 31 |
31 } // namespace content | 32 } // namespace content |
32 | 33 |
33 #endif // CONTENT_COMMON_SANDBOX_SECCOMP_BPF_LINUX_H_ | 34 #endif // CONTENT_COMMON_SANDBOX_SECCOMP_BPF_LINUX_H_ |
34 | 35 |
OLD | NEW |