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

Side by Side Diff: content/common/sandbox_win.cc

Issue 177863002: Refactor configuration of sandboxes - first steps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix remaining nits and rebase Created 6 years, 9 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
« no previous file with comments | « content/browser/worker_host/worker_process_host.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/worker_host/worker_process_host.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698