| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/public/common/sandbox_init.h" | 5 #include "content/public/common/sandbox_init.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "content/common/sandbox_policy.h" | 9 #include "content/common/sandbox_policy.h" |
| 10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
| 11 #include "sandbox/src/sandbox.h" | 11 #include "sandbox/win/src/sandbox.h" |
| 12 #include "sandbox/src/sandbox_types.h" | 12 #include "sandbox/win/src/sandbox_types.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 bool InitializeSandbox( | 16 bool InitializeSandbox( |
| 17 sandbox::SandboxInterfaceInfo* sandbox_info) { | 17 sandbox::SandboxInterfaceInfo* sandbox_info) { |
| 18 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 18 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 19 std::string process_type = | 19 std::string process_type = |
| 20 command_line.GetSwitchValueASCII(switches::kProcessType); | 20 command_line.GetSwitchValueASCII(switches::kProcessType); |
| 21 sandbox::BrokerServices* broker_services = sandbox_info->broker_services; | 21 sandbox::BrokerServices* broker_services = sandbox_info->broker_services; |
| 22 if (broker_services && (process_type.empty() || | 22 if (broker_services && (process_type.empty() || |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } else { | 60 } else { |
| 61 // Other process types might or might not be sandboxed. | 61 // Other process types might or might not be sandboxed. |
| 62 // TODO(cpu): clean this mess. | 62 // TODO(cpu): clean this mess. |
| 63 if (!target_services) | 63 if (!target_services) |
| 64 return true; | 64 return true; |
| 65 } | 65 } |
| 66 return sandbox::InitTargetServices(target_services); | 66 return sandbox::InitTargetServices(target_services); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace content | 69 } // namespace content |
| OLD | NEW |