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_SANDBOXED_PROCESS_LAUNCHER_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_SANDBOXED_PROCESS_LAUNCHER_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_COMMON_SANDBOXED_PROCESS_LAUNCHER_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_COMMON_SANDBOXED_PROCESS_LAUNCHER_DELEGATE_H_ |
7 | 7 |
| 8 #include <cstddef> |
| 9 |
8 #include "base/environment.h" | 10 #include "base/environment.h" |
9 #include "base/files/scoped_file.h" | 11 #include "base/files/scoped_file.h" |
10 #include "base/process/process.h" | 12 #include "base/process/process.h" |
11 #include "build/build_config.h" | 13 #include "build/build_config.h" |
12 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
13 #include "content/public/common/sandbox_type.h" | 15 #include "content/public/common/sandbox_type.h" |
| 16 #include "content/public/common/zygote_alias.h" |
14 | 17 |
15 namespace base { | 18 namespace base { |
16 class FilePath; | 19 class FilePath; |
17 } | 20 } |
18 | 21 |
19 namespace sandbox { | 22 namespace sandbox { |
20 class TargetPolicy; | 23 class TargetPolicy; |
21 } | 24 } |
22 | 25 |
23 namespace content { | 26 namespace content { |
(...skipping 20 matching lines...) Expand all Loading... |
44 // AddPolicyForSandboxedProcess. | 47 // AddPolicyForSandboxedProcess. |
45 virtual bool DisableDefaultPolicy(); | 48 virtual bool DisableDefaultPolicy(); |
46 | 49 |
47 // Called right before spawning the process. Returns false on failure. | 50 // Called right before spawning the process. Returns false on failure. |
48 virtual bool PreSpawnTarget(sandbox::TargetPolicy* policy); | 51 virtual bool PreSpawnTarget(sandbox::TargetPolicy* policy); |
49 | 52 |
50 // Called right after the process is launched, but before its thread is run. | 53 // Called right after the process is launched, but before its thread is run. |
51 virtual void PostSpawnTarget(base::ProcessHandle process) {} | 54 virtual void PostSpawnTarget(base::ProcessHandle process) {} |
52 | 55 |
53 #elif defined(OS_POSIX) | 56 #elif defined(OS_POSIX) |
| 57 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
54 // Override this to return true to use the setuid sandbox. | 58 // Override this to return true to use the setuid sandbox. |
55 virtual bool ShouldUseZygote(); | 59 virtual ZygoteHandle* GetZygote(); |
| 60 #endif // !defined(OS_MACOSX) && !defined(OS_ANDROID) |
56 | 61 |
57 // Override this if the process needs a non-empty environment map. | 62 // Override this if the process needs a non-empty environment map. |
58 virtual base::EnvironmentMap GetEnvironment(); | 63 virtual base::EnvironmentMap GetEnvironment(); |
59 | 64 |
60 // Return the file descriptor for the IPC channel. | 65 // Return the file descriptor for the IPC channel. |
61 virtual base::ScopedFD TakeIpcFd() = 0; | 66 virtual base::ScopedFD TakeIpcFd() = 0; |
62 #endif | 67 #endif |
63 | 68 |
64 // Returns the SandboxType to enforce on the process, or SANDBOX_TYPE_INVALID | 69 // Returns the SandboxType to enforce on the process, or SANDBOX_TYPE_INVALID |
65 // for no sandbox policy. | 70 // for no sandbox policy. |
66 virtual SandboxType GetSandboxType(); | 71 virtual SandboxType GetSandboxType(); |
67 }; | 72 }; |
68 | 73 |
69 } // namespace content | 74 } // namespace content |
70 | 75 |
71 #endif // CONTENT_PUBLIC_COMMON_SANDBOXED_PROCESS_LAUNCHER_DELEGATE_H_ | 76 #endif // CONTENT_PUBLIC_COMMON_SANDBOXED_PROCESS_LAUNCHER_DELEGATE_H_ |
OLD | NEW |