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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 | 440 |
441 if (!AddGenericPolicy(policy)) { | 441 if (!AddGenericPolicy(policy)) { |
442 NOTREACHED(); | 442 NOTREACHED(); |
443 return 0; | 443 return 0; |
444 } | 444 } |
445 | 445 |
446 TRACE_EVENT_BEGIN_ETW("StartProcessWithAccess::LAUNCHPROCESS", 0, 0); | 446 TRACE_EVENT_BEGIN_ETW("StartProcessWithAccess::LAUNCHPROCESS", 0, 0); |
447 | 447 |
448 result = g_broker_services->SpawnTarget( | 448 result = g_broker_services->SpawnTarget( |
449 cmd_line->GetProgram().value().c_str(), | 449 cmd_line->GetProgram().value().c_str(), |
450 cmd_line->command_line_string().c_str(), | 450 cmd_line->GetCommandLineString().c_str(), |
451 policy, &target); | 451 policy, &target); |
452 policy->Release(); | 452 policy->Release(); |
453 | 453 |
454 TRACE_EVENT_END_ETW("StartProcessWithAccess::LAUNCHPROCESS", 0, 0); | 454 TRACE_EVENT_END_ETW("StartProcessWithAccess::LAUNCHPROCESS", 0, 0); |
455 | 455 |
456 if (sandbox::SBOX_ALL_OK != result) | 456 if (sandbox::SBOX_ALL_OK != result) |
457 return 0; | 457 return 0; |
458 | 458 |
459 ResumeThread(target.hThread); | 459 ResumeThread(target.hThread); |
460 CloseHandle(target.hThread); | 460 CloseHandle(target.hThread); |
461 process = target.hProcess; | 461 process = target.hProcess; |
462 | 462 |
463 // 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 |
464 // the process is in a sandbox. | 464 // the process is in a sandbox. |
465 if (child_needs_help) | 465 if (child_needs_help) |
466 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); | 466 base::debug::SpawnDebuggerOnProcess(target.dwProcessId); |
467 | 467 |
468 return process; | 468 return process; |
469 } | 469 } |
470 | 470 |
471 } // namespace sandbox | 471 } // namespace sandbox |
OLD | NEW |