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_PUBLIC_COMMON_SANDBOX_INIT_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_ |
6 #define CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_ | 6 #define CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_ |
7 | 7 |
8 #include "base/files/scoped_file.h" | 8 #include "base/files/scoped_file.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/process/process.h" | 10 #include "base/process/process.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // taken and true is always returned. | 81 // taken and true is always returned. |
82 CONTENT_EXPORT bool InitializeSandbox(int sandbox_type, | 82 CONTENT_EXPORT bool InitializeSandbox(int sandbox_type, |
83 const base::FilePath& allowed_path); | 83 const base::FilePath& allowed_path); |
84 | 84 |
85 #elif defined(OS_LINUX) | 85 #elif defined(OS_LINUX) |
86 | 86 |
87 class SandboxInitializerDelegate; | 87 class SandboxInitializerDelegate; |
88 | 88 |
89 // Initialize a seccomp-bpf sandbox. |policy| may not be NULL. | 89 // Initialize a seccomp-bpf sandbox. |policy| may not be NULL. |
90 // If an existing layer of sandboxing is present that would prevent access to | 90 // If an existing layer of sandboxing is present that would prevent access to |
91 // /proc, |proc_task_fd| must be a valid file descriptor to /proc/self/task. | 91 // /proc, |proc_fd| must be a valid file descriptor to /proc/. |
92 // Returns true if the sandbox has been properly engaged. | 92 // Returns true if the sandbox has been properly engaged. |
93 CONTENT_EXPORT bool InitializeSandbox( | 93 CONTENT_EXPORT bool InitializeSandbox( |
94 scoped_ptr<sandbox::bpf_dsl::Policy> policy, | 94 scoped_ptr<sandbox::bpf_dsl::Policy> policy, |
95 base::ScopedFD proc_task_fd); | 95 base::ScopedFD proc_fd); |
96 | 96 |
97 // Return a "baseline" policy. This is used by a SandboxInitializerDelegate to | 97 // Return a "baseline" policy. This is used by a SandboxInitializerDelegate to |
98 // implement a policy that is derived from the baseline. | 98 // implement a policy that is derived from the baseline. |
99 CONTENT_EXPORT scoped_ptr<sandbox::bpf_dsl::Policy> | 99 CONTENT_EXPORT scoped_ptr<sandbox::bpf_dsl::Policy> |
100 GetBPFSandboxBaselinePolicy(); | 100 GetBPFSandboxBaselinePolicy(); |
101 #endif // defined(OS_LINUX) | 101 #endif // defined(OS_LINUX) |
102 | 102 |
103 } // namespace content | 103 } // namespace content |
104 | 104 |
105 #endif // CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_ | 105 #endif // CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_ |
OLD | NEW |