OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 sandbox::TargetPolicy* policy = g_broker_services->CreatePolicy(); | 393 sandbox::TargetPolicy* policy = g_broker_services->CreatePolicy(); |
394 | 394 |
395 if (type == ChildProcessInfo::PLUGIN_PROCESS && | 395 if (type == ChildProcessInfo::PLUGIN_PROCESS && |
396 !browser_command_line.HasSwitch(switches::kNoSandbox) && | 396 !browser_command_line.HasSwitch(switches::kNoSandbox) && |
397 content::GetContentClient()->SandboxPlugin(cmd_line, policy)) { | 397 content::GetContentClient()->SandboxPlugin(cmd_line, policy)) { |
398 in_sandbox = true; | 398 in_sandbox = true; |
399 } | 399 } |
400 | 400 |
401 if (!in_sandbox) { | 401 if (!in_sandbox) { |
402 policy->Release(); | 402 policy->Release(); |
403 base::LaunchOptions options; | 403 base::LaunchProcess(*cmd_line, base::LaunchOptions(), &process); |
404 options.process_handle = &process; | |
405 base::LaunchProcess(*cmd_line, options); | |
406 return process; | 404 return process; |
407 } | 405 } |
408 | 406 |
409 if (type == ChildProcessInfo::PLUGIN_PROCESS) { | 407 if (type == ChildProcessInfo::PLUGIN_PROCESS) { |
410 AddDllEvictionPolicy(policy); | 408 AddDllEvictionPolicy(policy); |
411 } else if (type == ChildProcessInfo::GPU_PROCESS) { | 409 } else if (type == ChildProcessInfo::GPU_PROCESS) { |
412 if (!AddPolicyForGPU(cmd_line, policy)) | 410 if (!AddPolicyForGPU(cmd_line, policy)) |
413 return 0; | 411 return 0; |
414 } else if (type == ChildProcessInfo::PPAPI_PLUGIN_PROCESS) { | 412 } else if (type == ChildProcessInfo::PPAPI_PLUGIN_PROCESS) { |
415 if (!AddPolicyForPepperPlugin(policy)) | 413 if (!AddPolicyForPepperPlugin(policy)) |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 | 462 |
465 // Help the process a little. It can't start the debugger by itself if | 463 // Help the process a little. It can't start the debugger by itself if |
466 // the process is in a sandbox. | 464 // the process is in a sandbox. |
467 if (child_needs_help) | 465 if (child_needs_help) |
468 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); | 466 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); |
469 | 467 |
470 return process; | 468 return process; |
471 } | 469 } |
472 | 470 |
473 } // namespace sandbox | 471 } // namespace sandbox |
OLD | NEW |