| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/common/sandbox_policy.h" | 5 #include "chrome/common/sandbox_policy.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/win/win_util.h" | 9 #include "app/win/win_util.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 (type != ChildProcessInfo::NACL_BROKER_PROCESS) && | 531 (type != ChildProcessInfo::NACL_BROKER_PROCESS) && |
| 532 (type != ChildProcessInfo::GPU_PROCESS) && | 532 (type != ChildProcessInfo::GPU_PROCESS) && |
| 533 (type != ChildProcessInfo::PLUGIN_PROCESS); | 533 (type != ChildProcessInfo::PLUGIN_PROCESS); |
| 534 | 534 |
| 535 // Second case: If it is the plugin process then it depends on it being | 535 // Second case: If it is the plugin process then it depends on it being |
| 536 // the built-in flash, the user forcing plugins into sandbox or the | 536 // the built-in flash, the user forcing plugins into sandbox or the |
| 537 // the user explicitly excluding flash from the sandbox. | 537 // the user explicitly excluding flash from the sandbox. |
| 538 if (!in_sandbox && (type == ChildProcessInfo::PLUGIN_PROCESS)) { | 538 if (!in_sandbox && (type == ChildProcessInfo::PLUGIN_PROCESS)) { |
| 539 in_sandbox = browser_command_line.HasSwitch(switches::kSafePlugins) || | 539 in_sandbox = browser_command_line.HasSwitch(switches::kSafePlugins) || |
| 540 (IsBuiltInFlash(cmd_line, NULL) && | 540 (IsBuiltInFlash(cmd_line, NULL) && |
| 541 (base::win::GetVersion() > base::win::VERSION_XP) && |
| 541 !browser_command_line.HasSwitch(switches::kDisableFlashSandbox)); | 542 !browser_command_line.HasSwitch(switches::kDisableFlashSandbox)); |
| 542 } | 543 } |
| 543 | 544 |
| 544 if (browser_command_line.HasSwitch(switches::kNoSandbox)) { | 545 if (browser_command_line.HasSwitch(switches::kNoSandbox)) { |
| 545 // The user has explicity opted-out from all sandboxing. | 546 // The user has explicity opted-out from all sandboxing. |
| 546 in_sandbox = false; | 547 in_sandbox = false; |
| 547 } | 548 } |
| 548 | 549 |
| 549 #if !defined (GOOGLE_CHROME_BUILD) | 550 #if !defined (GOOGLE_CHROME_BUILD) |
| 550 if (browser_command_line.HasSwitch(switches::kInProcessPlugins)) { | 551 if (browser_command_line.HasSwitch(switches::kInProcessPlugins)) { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 | 638 |
| 638 // Help the process a little. It can't start the debugger by itself if | 639 // Help the process a little. It can't start the debugger by itself if |
| 639 // the process is in a sandbox. | 640 // the process is in a sandbox. |
| 640 if (child_needs_help) | 641 if (child_needs_help) |
| 641 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); | 642 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); |
| 642 | 643 |
| 643 return process; | 644 return process; |
| 644 } | 645 } |
| 645 | 646 |
| 646 } // namespace sandbox | 647 } // namespace sandbox |
| OLD | NEW |