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