| 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 // To decide if the process is going to be sandboxed we have two cases. | 433 // To decide if the process is going to be sandboxed we have two cases. |
| 434 // First case: all process types except the nacl broker, and the plugin | 434 // First case: all process types except the nacl broker, and the plugin |
| 435 // process are sandboxed by default. | 435 // process are sandboxed by default. |
| 436 bool in_sandbox = | 436 bool in_sandbox = |
| 437 (type != content::PROCESS_TYPE_NACL_BROKER) && | 437 (type != content::PROCESS_TYPE_NACL_BROKER) && |
| 438 (type != content::PROCESS_TYPE_PLUGIN) && | 438 (type != content::PROCESS_TYPE_PLUGIN) && |
| 439 (type != content::PROCESS_TYPE_PPAPI_BROKER); | 439 (type != content::PROCESS_TYPE_PPAPI_BROKER); |
| 440 | 440 |
| 441 // If it is the GPU process then it can be disabled by a command line flag. | 441 // If it is the GPU process then it can be disabled by a command line flag. |
| 442 if ((type == content::PROCESS_TYPE_GPU) && | 442 if ((type == content::PROCESS_TYPE_GPU) && |
| 443 (browser_command_line.HasSwitch(switches::kDisableGpuSandbox))) { | 443 (cmd_line->HasSwitch(switches::kDisableGpuSandbox))) { |
| 444 in_sandbox = false; | 444 in_sandbox = false; |
| 445 DVLOG(1) << "GPU sandbox is disabled"; | 445 DVLOG(1) << "GPU sandbox is disabled"; |
| 446 } | 446 } |
| 447 | 447 |
| 448 if (browser_command_line.HasSwitch(switches::kNoSandbox) || | 448 if (browser_command_line.HasSwitch(switches::kNoSandbox) || |
| 449 cmd_line->HasSwitch(switches::kNoSandbox)) { | 449 cmd_line->HasSwitch(switches::kNoSandbox)) { |
| 450 // The user or the caller has explicity opted-out from all sandboxing. | 450 // The user or the caller has explicity opted-out from all sandboxing. |
| 451 in_sandbox = false; | 451 in_sandbox = false; |
| 452 } | 452 } |
| 453 | 453 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 | 584 |
| 585 // Help the process a little. It can't start the debugger by itself if | 585 // Help the process a little. It can't start the debugger by itself if |
| 586 // the process is in a sandbox. | 586 // the process is in a sandbox. |
| 587 if (child_needs_help) | 587 if (child_needs_help) |
| 588 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); | 588 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); |
| 589 | 589 |
| 590 return process; | 590 return process; |
| 591 } | 591 } |
| 592 | 592 |
| 593 } // namespace sandbox | 593 } // namespace sandbox |
| OLD | NEW |