OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_COMMON_SANDBOX_INIT_WRAPPER_H_ | 5 #ifndef CHROME_COMMON_SANDBOX_INIT_WRAPPER_H_ |
6 #define CHROME_COMMON_SANDBOX_INIT_WRAPPER_H_ | 6 #define CHROME_COMMON_SANDBOX_INIT_WRAPPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 // Wraps the sandbox initialization and platform variables to consolodate | 9 // Wraps the sandbox initialization and platform variables to consolodate |
10 // the code and reduce the number of platform ifdefs elsewhere. The POSIX | 10 // the code and reduce the number of platform ifdefs elsewhere. The POSIX |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 class SandboxInitWrapper { | 26 class SandboxInitWrapper { |
27 public: | 27 public: |
28 SandboxInitWrapper() : broker_services_(), target_services_() { } | 28 SandboxInitWrapper() : broker_services_(), target_services_() { } |
29 // SetServices() needs to be called before InitializeSandbox() on Win32 with | 29 // SetServices() needs to be called before InitializeSandbox() on Win32 with |
30 // the info received from the chrome exe main. | 30 // the info received from the chrome exe main. |
31 void SetServices(sandbox::SandboxInterfaceInfo* sandbox_info); | 31 void SetServices(sandbox::SandboxInterfaceInfo* sandbox_info); |
32 sandbox::BrokerServices* BrokerServices() const { return broker_services_; } | 32 sandbox::BrokerServices* BrokerServices() const { return broker_services_; } |
33 sandbox::TargetServices* TargetServices() const { return target_services_; } | 33 sandbox::TargetServices* TargetServices() const { return target_services_; } |
34 | 34 |
35 // Initialize the sandbox for renderer and plug-in processes, depending on | 35 // Initialize the sandbox for renderer, gpu, utility, worker, nacl, and |
36 // the command line flags. The browser process is not sandboxed. | 36 // plug-in processes, depending on the command line flags. The browser |
| 37 // process is not sandboxed. |
37 // Returns true if the sandbox was initialized succesfully, false if an error | 38 // Returns true if the sandbox was initialized succesfully, false if an error |
38 // occurred. If process_type isn't one that needs sandboxing true is always | 39 // occurred. If process_type isn't one that needs sandboxing true is always |
39 // returned. | 40 // returned. |
40 bool InitializeSandbox(const CommandLine& parsed_command_line, | 41 bool InitializeSandbox(const CommandLine& parsed_command_line, |
41 const std::string& process_type); | 42 const std::string& process_type); |
42 private: | 43 private: |
43 sandbox::BrokerServices* broker_services_; | 44 sandbox::BrokerServices* broker_services_; |
44 sandbox::TargetServices* target_services_; | 45 sandbox::TargetServices* target_services_; |
45 | 46 |
46 DISALLOW_COPY_AND_ASSIGN(SandboxInitWrapper); | 47 DISALLOW_COPY_AND_ASSIGN(SandboxInitWrapper); |
(...skipping 13 matching lines...) Expand all Loading... |
60 bool InitializeSandbox(const CommandLine& parsed_command_line, | 61 bool InitializeSandbox(const CommandLine& parsed_command_line, |
61 const std::string& process_type); | 62 const std::string& process_type); |
62 | 63 |
63 private: | 64 private: |
64 DISALLOW_COPY_AND_ASSIGN(SandboxInitWrapper); | 65 DISALLOW_COPY_AND_ASSIGN(SandboxInitWrapper); |
65 }; | 66 }; |
66 | 67 |
67 #endif | 68 #endif |
68 | 69 |
69 #endif // CHROME_COMMON_SANDBOX_INIT_WRAPPER_H_ | 70 #endif // CHROME_COMMON_SANDBOX_INIT_WRAPPER_H_ |
OLD | NEW |