| 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/common/sandbox_policy.h" | 5 #include "content/common/sandbox_policy.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/debugger.h" | 10 #include "base/debug/debugger.h" |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 return true; | 304 return true; |
| 305 } | 305 } |
| 306 | 306 |
| 307 // For the GPU process we gotten as far as USER_LIMITED. The next level | 307 // For the GPU process we gotten as far as USER_LIMITED. The next level |
| 308 // which is USER_RESTRICTED breaks both the DirectX backend and the OpenGL | 308 // which is USER_RESTRICTED breaks both the DirectX backend and the OpenGL |
| 309 // backend. Note that the GPU process is connected to the interactive | 309 // backend. Note that the GPU process is connected to the interactive |
| 310 // desktop. | 310 // desktop. |
| 311 // TODO(cpu): Lock down the sandbox more if possible. | 311 // TODO(cpu): Lock down the sandbox more if possible. |
| 312 bool AddPolicyForGPU(CommandLine* cmd_line, sandbox::TargetPolicy* policy) { | 312 bool AddPolicyForGPU(CommandLine* cmd_line, sandbox::TargetPolicy* policy) { |
| 313 #if !defined(NACL_WIN64) // We don't need this code on win nacl64. | 313 #if !defined(NACL_WIN64) // We don't need this code on win nacl64. |
| 314 if (base::win::GetVersion() > base::win::VERSION_XP) { | 314 if (base::win::GetVersion() > base::win::VERSION_SERVER_2003) { |
| 315 if (cmd_line->GetSwitchValueASCII(switches::kUseGL) == | 315 if (cmd_line->GetSwitchValueASCII(switches::kUseGL) == |
| 316 gfx::kGLImplementationDesktopName) { | 316 gfx::kGLImplementationDesktopName) { |
| 317 // Open GL path. | 317 // Open GL path. |
| 318 policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS, | 318 policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS, |
| 319 sandbox::USER_LIMITED); | 319 sandbox::USER_LIMITED); |
| 320 policy->SetJobLevel(sandbox::JOB_UNPROTECTED, 0); | 320 policy->SetJobLevel(sandbox::JOB_UNPROTECTED, 0); |
| 321 policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW); | 321 policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW); |
| 322 } else { | 322 } else { |
| 323 if (cmd_line->GetSwitchValueASCII(switches::kUseGL) == | 323 if (cmd_line->GetSwitchValueASCII(switches::kUseGL) == |
| 324 gfx::kGLImplementationSwiftShaderName || | 324 gfx::kGLImplementationSwiftShaderName || |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 | 656 |
| 657 // Help the process a little. It can't start the debugger by itself if | 657 // Help the process a little. It can't start the debugger by itself if |
| 658 // the process is in a sandbox. | 658 // the process is in a sandbox. |
| 659 if (child_needs_help) | 659 if (child_needs_help) |
| 660 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); | 660 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); |
| 661 | 661 |
| 662 return process; | 662 return process; |
| 663 } | 663 } |
| 664 | 664 |
| 665 } // namespace sandbox | 665 } // namespace sandbox |
| OLD | NEW |