Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Side by Side Diff: chrome/common/sandbox_policy.cc

Issue 3817001: CommandLine: remove wstring-based program() accessor (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_util.h" 9 #include "app/win_util.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 } 555 }
556 556
557 if (!AddGenericPolicy(policy)) { 557 if (!AddGenericPolicy(policy)) {
558 NOTREACHED(); 558 NOTREACHED();
559 return 0; 559 return 0;
560 } 560 }
561 561
562 TRACE_EVENT_BEGIN("StartProcessWithAccess::LAUNCHPROCESS", 0, 0); 562 TRACE_EVENT_BEGIN("StartProcessWithAccess::LAUNCHPROCESS", 0, 0);
563 563
564 result = g_broker_services->SpawnTarget( 564 result = g_broker_services->SpawnTarget(
565 cmd_line->program().c_str(), 565 cmd_line->GetProgram().value().c_str(),
566 cmd_line->command_line_string().c_str(), 566 cmd_line->command_line_string().c_str(),
567 policy, &target); 567 policy, &target);
568 policy->Release(); 568 policy->Release();
569 569
570 TRACE_EVENT_END("StartProcessWithAccess::LAUNCHPROCESS", 0, 0); 570 TRACE_EVENT_END("StartProcessWithAccess::LAUNCHPROCESS", 0, 0);
571 571
572 if (sandbox::SBOX_ALL_OK != result) 572 if (sandbox::SBOX_ALL_OK != result)
573 return 0; 573 return 0;
574 574
575 ResumeThread(target.hThread); 575 ResumeThread(target.hThread);
576 CloseHandle(target.hThread); 576 CloseHandle(target.hThread);
577 process = target.hProcess; 577 process = target.hProcess;
578 578
579 // Help the process a little. It can't start the debugger by itself if 579 // Help the process a little. It can't start the debugger by itself if
580 // the process is in a sandbox. 580 // the process is in a sandbox.
581 if (child_needs_help) 581 if (child_needs_help)
582 DebugUtil::SpawnDebuggerOnProcess(target.dwProcessId); 582 DebugUtil::SpawnDebuggerOnProcess(target.dwProcessId);
583 583
584 return process; 584 return process;
585 } 585 }
586 586
587 } // namespace sandbox 587 } // namespace sandbox
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698