OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "content/common/sandbox_init_wrapper.h" | 5 #include "content/common/sandbox_init_wrapper.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "content/common/content_switches.h" | |
11 #include "content/common/sandbox_mac.h" | 10 #include "content/common/sandbox_mac.h" |
| 11 #include "content/public/common/content_switches.h" |
12 | 12 |
13 bool SandboxInitWrapper::InitializeSandbox(const CommandLine& command_line, | 13 bool SandboxInitWrapper::InitializeSandbox(const CommandLine& command_line, |
14 const std::string& process_type) { | 14 const std::string& process_type) { |
15 using sandbox::Sandbox; | 15 using sandbox::Sandbox; |
16 | 16 |
17 if (command_line.HasSwitch(switches::kNoSandbox)) | 17 if (command_line.HasSwitch(switches::kNoSandbox)) |
18 return true; | 18 return true; |
19 | 19 |
20 Sandbox::SandboxProcessType sandbox_process_type; | 20 Sandbox::SandboxProcessType sandbox_process_type; |
21 FilePath allowed_dir; // Empty by default. | 21 FilePath allowed_dir; // Empty by default. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 NOTREACHED() << "Unknown process type " << process_type; | 58 NOTREACHED() << "Unknown process type " << process_type; |
59 return true; | 59 return true; |
60 } | 60 } |
61 | 61 |
62 // Warm up APIs before turning on the sandbox. | 62 // Warm up APIs before turning on the sandbox. |
63 Sandbox::SandboxWarmup(sandbox_process_type); | 63 Sandbox::SandboxWarmup(sandbox_process_type); |
64 | 64 |
65 // Actually sandbox the process. | 65 // Actually sandbox the process. |
66 return Sandbox::EnableSandbox(sandbox_process_type, allowed_dir); | 66 return Sandbox::EnableSandbox(sandbox_process_type, allowed_dir); |
67 } | 67 } |
OLD | NEW |