OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_win.h" | 5 #include "content/common/sandbox_win.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 base::ProcessHandle StartSandboxedProcess( | 569 base::ProcessHandle StartSandboxedProcess( |
570 SandboxedProcessLauncherDelegate* delegate, | 570 SandboxedProcessLauncherDelegate* delegate, |
571 CommandLine* cmd_line) { | 571 CommandLine* cmd_line) { |
572 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 572 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
573 std::string type_str = cmd_line->GetSwitchValueASCII(switches::kProcessType); | 573 std::string type_str = cmd_line->GetSwitchValueASCII(switches::kProcessType); |
574 | 574 |
575 TRACE_EVENT_BEGIN_ETW("StartProcessWithAccess", 0, type_str); | 575 TRACE_EVENT_BEGIN_ETW("StartProcessWithAccess", 0, type_str); |
576 | 576 |
577 bool in_sandbox = true; | 577 bool in_sandbox = true; |
578 if (delegate) | 578 if (delegate) |
579 delegate->ShouldSandbox(&in_sandbox); | 579 in_sandbox = delegate->ShouldSandbox(); |
580 | 580 |
581 if (browser_command_line.HasSwitch(switches::kNoSandbox) || | 581 if (browser_command_line.HasSwitch(switches::kNoSandbox) || |
582 cmd_line->HasSwitch(switches::kNoSandbox)) { | 582 cmd_line->HasSwitch(switches::kNoSandbox)) { |
583 // The user or the caller has explicity opted-out from all sandboxing. | 583 // The user or the caller has explicity opted-out from all sandboxing. |
584 in_sandbox = false; | 584 in_sandbox = false; |
585 } | 585 } |
586 | 586 |
587 | 587 |
588 // Propagate the --allow-no-job flag if present. | 588 // Propagate the --allow-no-job flag if present. |
589 if (browser_command_line.HasSwitch(switches::kAllowNoSandboxJob) && | 589 if (browser_command_line.HasSwitch(switches::kAllowNoSandboxJob) && |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 } | 739 } |
740 | 740 |
741 return false; | 741 return false; |
742 } | 742 } |
743 | 743 |
744 bool BrokerAddTargetPeer(HANDLE peer_process) { | 744 bool BrokerAddTargetPeer(HANDLE peer_process) { |
745 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; | 745 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; |
746 } | 746 } |
747 | 747 |
748 } // namespace content | 748 } // namespace content |
OLD | NEW |