| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/files/scoped_file.h" | 10 #include "base/files/scoped_file.h" |
| 11 #include "base/memory/shared_memory.h" | 11 #include "base/memory/shared_memory.h" |
| 12 #include "base/process/launch.h" | 12 #include "base/process/launch.h" |
| 13 #include "base/process/process.h" | 13 #include "base/process/process.h" |
| 14 #include "base/process/process_handle.h" | 14 #include "base/process/process_handle.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 17 | 17 |
| 18 #if defined(OS_WIN) |
| 19 #include "sandbox/win/src/sandbox_types.h" |
| 20 #endif |
| 21 |
| 18 namespace base { | 22 namespace base { |
| 19 class CommandLine; | 23 class CommandLine; |
| 20 class FilePath; | 24 class FilePath; |
| 21 } | 25 } |
| 22 | 26 |
| 23 namespace sandbox { | 27 namespace sandbox { |
| 24 namespace bpf_dsl { | 28 namespace bpf_dsl { |
| 25 class Policy; | 29 class Policy; |
| 26 } | 30 } |
| 27 struct SandboxInterfaceInfo; | 31 struct SandboxInterfaceInfo; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 48 // BrokerDuplicateHandle() to send handles to a process managed by | 52 // BrokerDuplicateHandle() to send handles to a process managed by |
| 49 // another broker. For example, it allows the 32-bit renderer to send | 53 // another broker. For example, it allows the 32-bit renderer to send |
| 50 // handles to 64-bit NaCl processes. This returns true on success, | 54 // handles to 64-bit NaCl processes. This returns true on success, |
| 51 // false otherwise. | 55 // false otherwise. |
| 52 CONTENT_EXPORT bool BrokerAddTargetPeer(HANDLE peer_process); | 56 CONTENT_EXPORT bool BrokerAddTargetPeer(HANDLE peer_process); |
| 53 | 57 |
| 54 // Launch a sandboxed process. |delegate| may be NULL. If |delegate| is non-NULL | 58 // Launch a sandboxed process. |delegate| may be NULL. If |delegate| is non-NULL |
| 55 // then it just has to outlive this method call. |handles_to_inherit| is a list | 59 // then it just has to outlive this method call. |handles_to_inherit| is a list |
| 56 // of handles for the child process to inherit. The caller retains ownership of | 60 // of handles for the child process to inherit. The caller retains ownership of |
| 57 // the handles. | 61 // the handles. |
| 58 CONTENT_EXPORT base::Process StartSandboxedProcess( | 62 CONTENT_EXPORT sandbox::ResultCode StartSandboxedProcess( |
| 59 SandboxedProcessLauncherDelegate* delegate, | 63 SandboxedProcessLauncherDelegate* delegate, |
| 60 base::CommandLine* cmd_line, | 64 base::CommandLine* cmd_line, |
| 61 const base::HandlesToInheritVector& handles_to_inherit); | 65 const base::HandlesToInheritVector& handles_to_inherit, |
| 66 base::Process* process); |
| 62 | 67 |
| 63 #elif defined(OS_MACOSX) | 68 #elif defined(OS_MACOSX) |
| 64 | 69 |
| 65 // Initialize the sandbox of the given |sandbox_type|, optionally specifying a | 70 // Initialize the sandbox of the given |sandbox_type|, optionally specifying a |
| 66 // directory to allow access to. Note specifying a directory needs to be | 71 // directory to allow access to. Note specifying a directory needs to be |
| 67 // supported by the sandbox profile associated with the given |sandbox_type|. | 72 // supported by the sandbox profile associated with the given |sandbox_type|. |
| 68 // Valid values for |sandbox_type| are defined either by the enum SandboxType, | 73 // Valid values for |sandbox_type| are defined either by the enum SandboxType, |
| 69 // or by ContentClient::GetSandboxProfileForSandboxType(). | 74 // or by ContentClient::GetSandboxProfileForSandboxType(). |
| 70 // | 75 // |
| 71 // If the |sandbox_type| isn't one of the ones defined by content then the | 76 // If the |sandbox_type| isn't one of the ones defined by content then the |
| (...skipping 21 matching lines...) Expand all Loading... |
| 93 | 98 |
| 94 // Return a "baseline" policy. This is used by a SandboxInitializerDelegate to | 99 // Return a "baseline" policy. This is used by a SandboxInitializerDelegate to |
| 95 // implement a policy that is derived from the baseline. | 100 // implement a policy that is derived from the baseline. |
| 96 CONTENT_EXPORT std::unique_ptr<sandbox::bpf_dsl::Policy> | 101 CONTENT_EXPORT std::unique_ptr<sandbox::bpf_dsl::Policy> |
| 97 GetBPFSandboxBaselinePolicy(); | 102 GetBPFSandboxBaselinePolicy(); |
| 98 #endif // defined(OS_LINUX) || defined(OS_NACL_NONSFI) | 103 #endif // defined(OS_LINUX) || defined(OS_NACL_NONSFI) |
| 99 | 104 |
| 100 } // namespace content | 105 } // namespace content |
| 101 | 106 |
| 102 #endif // CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_ | 107 #endif // CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_ |
| OLD | NEW |