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 | 7 |
8 // Wraps the sandbox initialization and platform variables to consolodate | 8 // Wraps the sandbox initialization and platform variables to consolodate |
9 // the code and reduce the number of platform ifdefs elsewhere. The POSIX | 9 // the code and reduce the number of platform ifdefs elsewhere. The POSIX |
10 // version of this wrapper is basically empty. | 10 // version of this wrapper is basically empty. |
(...skipping 16 matching lines...) Expand all Loading... |
27 SandboxInitWrapper() : broker_services_(), target_services_() { } | 27 SandboxInitWrapper() : broker_services_(), target_services_() { } |
28 // SetServices() needs to be called before InitializeSandbox() on Win32 with | 28 // SetServices() needs to be called before InitializeSandbox() on Win32 with |
29 // the info received from the chrome exe main. | 29 // the info received from the chrome exe main. |
30 void SetServices(sandbox::SandboxInterfaceInfo* sandbox_info); | 30 void SetServices(sandbox::SandboxInterfaceInfo* sandbox_info); |
31 sandbox::BrokerServices* BrokerServices() const { return broker_services_; } | 31 sandbox::BrokerServices* BrokerServices() const { return broker_services_; } |
32 sandbox::TargetServices* TargetServices() const { return target_services_; } | 32 sandbox::TargetServices* TargetServices() const { return target_services_; } |
33 | 33 |
34 // Initialize the sandbox for renderer and plug-in processes, depending on | 34 // Initialize the sandbox for renderer and plug-in processes, depending on |
35 // the command line flags. The browser process is not sandboxed. | 35 // the command line flags. The browser process is not sandboxed. |
36 void InitializeSandbox(const CommandLine& parsed_command_line, | 36 void InitializeSandbox(const CommandLine& parsed_command_line, |
37 const std::wstring& process_type); | 37 const std::string& process_type); |
38 private: | 38 private: |
39 sandbox::BrokerServices* broker_services_; | 39 sandbox::BrokerServices* broker_services_; |
40 sandbox::TargetServices* target_services_; | 40 sandbox::TargetServices* target_services_; |
41 | 41 |
42 DISALLOW_COPY_AND_ASSIGN(SandboxInitWrapper); | 42 DISALLOW_COPY_AND_ASSIGN(SandboxInitWrapper); |
43 }; | 43 }; |
44 | 44 |
45 #elif defined(OS_POSIX) | 45 #elif defined(OS_POSIX) |
46 | 46 |
47 class SandboxInitWrapper { | 47 class SandboxInitWrapper { |
48 public: | 48 public: |
49 SandboxInitWrapper() { } | 49 SandboxInitWrapper() { } |
50 | 50 |
51 // Initialize the sandbox for renderer and plug-in processes, depending on | 51 // Initialize the sandbox for renderer and plug-in processes, depending on |
52 // the command line flags. The browser process is not sandboxed. | 52 // the command line flags. The browser process is not sandboxed. |
53 void InitializeSandbox(const CommandLine& parsed_command_line, | 53 void InitializeSandbox(const CommandLine& parsed_command_line, |
54 const std::wstring& process_type); | 54 const std::string& process_type); |
55 | 55 |
56 #if defined(OS_MACOSX) | 56 #if defined(OS_MACOSX) |
57 // We keep the process type so we can configure the sandbox as needed. | 57 // We keep the process type so we can configure the sandbox as needed. |
58 public: | 58 public: |
59 std::wstring ProcessType() const { return process_type_; } | 59 std::string ProcessType() const { return process_type_; } |
60 private: | 60 private: |
61 std::wstring process_type_; | 61 std::string process_type_; |
62 #endif | 62 #endif |
63 | 63 |
64 private: | 64 private: |
65 DISALLOW_COPY_AND_ASSIGN(SandboxInitWrapper); | 65 DISALLOW_COPY_AND_ASSIGN(SandboxInitWrapper); |
66 }; | 66 }; |
67 | 67 |
68 #endif | 68 #endif |
69 | 69 |
70 #endif // CHROME_COMMON_SANDBOX_INIT_WRAPPER_H_ | 70 #endif // CHROME_COMMON_SANDBOX_INIT_WRAPPER_H_ |
OLD | NEW |