Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: content/common/sandbox_policy.cc

Issue 10012029: Windows: Reduce GPU process sandbox to XP level on Windows Server 2003. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698