| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2009 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 CHROME_COMMON_SANDBOX_INIT_WRAPPER_H_ |
| 6 #define CHROME_COMMON_SANDBOX_INIT_WRAPPER_H_ |
| 7 |
| 8 // Wraps the sandbox initialization and platform variables to consolodate |
| 9 // the code and reduce the number of platform ifdefs elsewhere. The POSIX |
| 10 // version of this wrapper is basically empty. |
| 11 |
| 12 #include "build/build_config.h" |
| 13 |
| 14 #include <string> |
| 15 #if defined(OS_WIN) |
| 16 #include "sandbox/src/sandbox.h" |
| 17 #endif |
| 18 |
| 19 class CommandLine; |
| 20 |
| 21 #if defined(OS_WIN) |
| 22 |
| 23 class SandboxInitWrapper { |
| 24 public: |
| 25 SandboxInitWrapper() : broker_services_(), target_services_() { } |
| 26 // SetServices() needs to be called before InitializeSandbox() on Win32 with |
| 27 // the info received from the chrome exe main. |
| 28 void SetServices(sandbox::SandboxInterfaceInfo* sandbox_info); |
| 29 sandbox::BrokerServices* BrokerServices() const { return broker_services_; } |
| 30 sandbox::TargetServices* TargetServices() const { return target_services_; } |
| 31 |
| 32 // Initialize the sandbox for renderer and plug-in processes, depending on |
| 33 // the command line flags. The browser process is not sandboxed. |
| 34 void InitializeSandbox(const CommandLine& parsed_command_line, |
| 35 const std::wstring& process_type); |
| 36 private: |
| 37 sandbox::BrokerServices* broker_services_; |
| 38 sandbox::TargetServices* target_services_; |
| 39 }; |
| 40 |
| 41 #elif defined(OS_POSIX) |
| 42 |
| 43 class SandboxInitWrapper { |
| 44 public: |
| 45 SandboxInitWrapper() { } |
| 46 |
| 47 // Initialize the sandbox for renderer and plug-in processes, depending on |
| 48 // the command line flags. The browser process is not sandboxed. |
| 49 void InitializeSandbox(const CommandLine& parsed_command_line, |
| 50 const std::wstring& process_type); |
| 51 }; |
| 52 |
| 53 #endif |
| 54 |
| 55 #endif // CHROME_COMMON_SANDBOX_INIT_WRAPPER_H_ |
| OLD | NEW |