OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_PUBLIC_COMMON_SANDBOXED_PROCESS_LAUNCHER_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_COMMON_SANDBOXED_PROCESS_LAUNCHER_DELEGATE_H_ |
| 7 |
| 8 #include "base/process.h" |
| 9 |
| 10 namespace base { |
| 11 class FilePath; |
| 12 } |
| 13 |
| 14 namespace sandbox { |
| 15 class TargetPolicy; |
| 16 } |
| 17 |
| 18 namespace content { |
| 19 |
| 20 // Allows a caller of StartSandboxedProcess to control the sandbox policy, i.e. |
| 21 // to loosen it if needed. |
| 22 // The methods below will be called on the PROCESS_LAUNCHER thread. |
| 23 class SandboxedProcessLauncherDelegate { |
| 24 public: |
| 25 virtual ~SandboxedProcessLauncherDelegate() {} |
| 26 |
| 27 // Called before the default sandbox is applied. If the default policy is too |
| 28 // restrictive, the caller should set |disable_default_policy| to true and |
| 29 // apply their policy in PreSpawnTarget. |exposed_dir| is used to allow a |
| 30 //directory through the sandbox. |
| 31 virtual void PreSandbox(bool* disable_default_policy, |
| 32 base::FilePath* exposed_dir) {} |
| 33 |
| 34 // Called right before spawning the process. |
| 35 virtual void PreSpawnTarget(sandbox::TargetPolicy* policy, |
| 36 bool* success) {} |
| 37 |
| 38 // Called right after the process is launched, but before its thread is run. |
| 39 virtual void PostSpawnTarget(base::ProcessHandle process) {} |
| 40 }; |
| 41 |
| 42 } // namespace content |
| 43 |
| 44 #endif // CONTENT_PUBLIC_COMMON_SANDBOXED_PROCESS_LAUNCHER_DELEGATE_H_ |
OLD | NEW |