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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/process/process.h" | 9 #include "base/process/process.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 | 12 |
13 class CommandLine; | 13 class CommandLine; |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class FilePath; | 16 class FilePath; |
17 } | 17 } |
18 | 18 |
19 namespace playground2 { | |
20 class SandboxBpfPolicy; | |
21 } | |
22 | |
23 namespace sandbox { | 19 namespace sandbox { |
| 20 class SandboxBPFPolicy; |
24 struct SandboxInterfaceInfo; | 21 struct SandboxInterfaceInfo; |
25 } | 22 } |
26 | 23 |
27 namespace content { | 24 namespace content { |
28 class SandboxedProcessLauncherDelegate; | 25 class SandboxedProcessLauncherDelegate; |
29 | 26 |
30 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
31 | 28 |
32 // Initialize the sandbox for renderer, gpu, utility, worker, nacl, and plug-in | 29 // Initialize the sandbox for renderer, gpu, utility, worker, nacl, and plug-in |
33 // processes, depending on the command line flags. Although The browser process | 30 // processes, depending on the command line flags. Although The browser process |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 CONTENT_EXPORT bool InitializeSandbox(int sandbox_type, | 80 CONTENT_EXPORT bool InitializeSandbox(int sandbox_type, |
84 const base::FilePath& allowed_path); | 81 const base::FilePath& allowed_path); |
85 | 82 |
86 #elif defined(OS_LINUX) | 83 #elif defined(OS_LINUX) |
87 | 84 |
88 class SandboxInitializerDelegate; | 85 class SandboxInitializerDelegate; |
89 | 86 |
90 // Initialize a seccomp-bpf sandbox. |policy| may not be NULL. | 87 // Initialize a seccomp-bpf sandbox. |policy| may not be NULL. |
91 // Returns true if the sandbox has been properly engaged. | 88 // Returns true if the sandbox has been properly engaged. |
92 CONTENT_EXPORT bool InitializeSandbox( | 89 CONTENT_EXPORT bool InitializeSandbox( |
93 scoped_ptr<playground2::SandboxBpfPolicy> policy); | 90 scoped_ptr<sandbox::SandboxBPFPolicy> policy); |
94 | 91 |
95 // Return a "baseline" policy. This is used by a SandboxInitializerDelegate to | 92 // Return a "baseline" policy. This is used by a SandboxInitializerDelegate to |
96 // implement a policy that is derived from the baseline. | 93 // implement a policy that is derived from the baseline. |
97 CONTENT_EXPORT scoped_ptr<playground2::SandboxBpfPolicy> | 94 CONTENT_EXPORT scoped_ptr<sandbox::SandboxBPFPolicy> |
98 GetBpfSandboxBaselinePolicy(); | 95 GetBPFSandboxBaselinePolicy(); |
99 #endif // defined(OS_LINUX) | 96 #endif // defined(OS_LINUX) |
100 | 97 |
101 } // namespace content | 98 } // namespace content |
102 | 99 |
103 #endif // CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_ | 100 #endif // CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_ |
OLD | NEW |