| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 sandbox::USER_LIMITED); | 315 sandbox::USER_LIMITED); |
| 316 policy->SetJobLevel(sandbox::JOB_UNPROTECTED, 0); | 316 policy->SetJobLevel(sandbox::JOB_UNPROTECTED, 0); |
| 317 policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW); | 317 policy->SetDelayedIntegrityLevel(sandbox::INTEGRITY_LEVEL_LOW); |
| 318 } else { | 318 } else { |
| 319 if (cmd_line->GetSwitchValueASCII(switches::kUseGL) == | 319 if (cmd_line->GetSwitchValueASCII(switches::kUseGL) == |
| 320 gfx::kGLImplementationSwiftShaderName || | 320 gfx::kGLImplementationSwiftShaderName || |
| 321 cmd_line->HasSwitch(switches::kReduceGpuSandbox)) { | 321 cmd_line->HasSwitch(switches::kReduceGpuSandbox)) { |
| 322 policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS, | 322 policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS, |
| 323 sandbox::USER_LIMITED); | 323 sandbox::USER_LIMITED); |
| 324 } else { | 324 } else { |
| 325 // Temporarily reduce sandbox level while we disable the use of image | |
| 326 // transport surface in all versions of windows. | |
| 327 policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS, | 325 policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS, |
| 328 sandbox::USER_LIMITED); | 326 sandbox::USER_RESTRICTED); |
| 329 } | 327 } |
| 330 | 328 |
| 331 // UI restrictions break when we access Windows from outside our job. | 329 // UI restrictions break when we access Windows from outside our job. |
| 332 // However, we don't want a proxy window in this process because it can | 330 // However, we don't want a proxy window in this process because it can |
| 333 // introduce deadlocks where the renderer blocks on the gpu, which in | 331 // introduce deadlocks where the renderer blocks on the gpu, which in |
| 334 // turn blocks on the browser UI thread. So, instead we forgo a window | 332 // turn blocks on the browser UI thread. So, instead we forgo a window |
| 335 // message pump entirely and just add job restrictions to prevent child | 333 // message pump entirely and just add job restrictions to prevent child |
| 336 // processes. | 334 // processes. |
| 337 policy->SetJobLevel(sandbox::JOB_LIMITED_USER, | 335 policy->SetJobLevel(sandbox::JOB_LIMITED_USER, |
| 338 JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS | | 336 JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS | |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 | 586 |
| 589 // Help the process a little. It can't start the debugger by itself if | 587 // Help the process a little. It can't start the debugger by itself if |
| 590 // the process is in a sandbox. | 588 // the process is in a sandbox. |
| 591 if (child_needs_help) | 589 if (child_needs_help) |
| 592 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); | 590 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); |
| 593 | 591 |
| 594 return process; | 592 return process; |
| 595 } | 593 } |
| 596 | 594 |
| 597 } // namespace sandbox | 595 } // namespace sandbox |
| OLD | NEW |