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> | 8 #include <cstddef> |
9 | 9 |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // AddPolicyForSandboxedProcess. | 43 // AddPolicyForSandboxedProcess. |
44 virtual bool DisableDefaultPolicy(); | 44 virtual bool DisableDefaultPolicy(); |
45 | 45 |
46 // Called right before spawning the process. Returns false on failure. | 46 // Called right before spawning the process. Returns false on failure. |
47 virtual bool PreSpawnTarget(sandbox::TargetPolicy* policy); | 47 virtual bool PreSpawnTarget(sandbox::TargetPolicy* policy); |
48 | 48 |
49 // Called right after the process is launched, but before its thread is run. | 49 // Called right after the process is launched, but before its thread is run. |
50 virtual void PostSpawnTarget(base::ProcessHandle process) {} | 50 virtual void PostSpawnTarget(base::ProcessHandle process) {} |
51 | 51 |
52 #elif defined(OS_POSIX) | 52 #elif defined(OS_POSIX) |
| 53 |
53 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 54 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
54 // Override this to return true to use the setuid sandbox. | 55 // Returns the zygote used to launch the process. |
55 virtual ZygoteHandle* GetZygote(); | 56 // NOTE: For now Chrome always uses the same zygote for performance reasons. |
| 57 // http://crbug.com/569191 |
| 58 virtual ZygoteHandle GetZygote(); |
56 #endif // !defined(OS_MACOSX) && !defined(OS_ANDROID) | 59 #endif // !defined(OS_MACOSX) && !defined(OS_ANDROID) |
57 | 60 |
58 // Override this if the process needs a non-empty environment map. | 61 // Override this if the process needs a non-empty environment map. |
59 virtual base::EnvironmentMap GetEnvironment(); | 62 virtual base::EnvironmentMap GetEnvironment(); |
60 #endif | 63 #endif |
61 | 64 |
62 // Returns the SandboxType to enforce on the process, or SANDBOX_TYPE_INVALID | 65 // Returns the SandboxType to enforce on the process, or SANDBOX_TYPE_INVALID |
63 // for no sandbox policy. | 66 // for no sandbox policy. |
64 virtual SandboxType GetSandboxType(); | 67 virtual SandboxType GetSandboxType(); |
65 }; | 68 }; |
66 | 69 |
67 } // namespace content | 70 } // namespace content |
68 | 71 |
69 #endif // CONTENT_PUBLIC_COMMON_SANDBOXED_PROCESS_LAUNCHER_DELEGATE_H_ | 72 #endif // CONTENT_PUBLIC_COMMON_SANDBOXED_PROCESS_LAUNCHER_DELEGATE_H_ |
OLD | NEW |