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

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

Issue 790003002: Update sandbox_win and delegate_execute to use the new version of LaunchProcess. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « no previous file | win8/delegate_execute/command_execute_impl.cc » ('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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 ProcessDebugFlags(cmd_line); 598 ProcessDebugFlags(cmd_line);
599 599
600 // Prefetch hints on windows: 600 // Prefetch hints on windows:
601 // Using a different prefetch profile per process type will allow Windows 601 // Using a different prefetch profile per process type will allow Windows
602 // to create separate pretetch settings for browser, renderer etc. 602 // to create separate pretetch settings for browser, renderer etc.
603 cmd_line->AppendArg(base::StringPrintf("/prefetch:%d", base::Hash(type_str))); 603 cmd_line->AppendArg(base::StringPrintf("/prefetch:%d", base::Hash(type_str)));
604 604
605 if ((delegate && !delegate->ShouldSandbox()) || 605 if ((delegate && !delegate->ShouldSandbox()) ||
606 browser_command_line.HasSwitch(switches::kNoSandbox) || 606 browser_command_line.HasSwitch(switches::kNoSandbox) ||
607 cmd_line->HasSwitch(switches::kNoSandbox)) { 607 cmd_line->HasSwitch(switches::kNoSandbox)) {
608 base::ProcessHandle handle = 0; 608 base::Process process =
609 base::LaunchProcess(*cmd_line, base::LaunchOptions(), &handle); 609 base::LaunchProcess(*cmd_line, base::LaunchOptions());
610 // TODO(rvargas) crbug.com/417532: Don't share a raw handle. 610 // TODO(rvargas) crbug.com/417532: Don't share a raw handle.
611 g_broker_services->AddTargetPeer(handle); 611 g_broker_services->AddTargetPeer(process.Handle());
612 return base::Process(handle); 612 return process.Pass();
613 } 613 }
614 614
615 sandbox::TargetPolicy* policy = g_broker_services->CreatePolicy(); 615 sandbox::TargetPolicy* policy = g_broker_services->CreatePolicy();
616 616
617 sandbox::MitigationFlags mitigations = sandbox::MITIGATION_HEAP_TERMINATE | 617 sandbox::MitigationFlags mitigations = sandbox::MITIGATION_HEAP_TERMINATE |
618 sandbox::MITIGATION_BOTTOM_UP_ASLR | 618 sandbox::MITIGATION_BOTTOM_UP_ASLR |
619 sandbox::MITIGATION_DEP | 619 sandbox::MITIGATION_DEP |
620 sandbox::MITIGATION_DEP_NO_ATL_THUNK | 620 sandbox::MITIGATION_DEP_NO_ATL_THUNK |
621 sandbox::MITIGATION_SEHOP; 621 sandbox::MITIGATION_SEHOP;
622 622
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 } 763 }
764 764
765 return false; 765 return false;
766 } 766 }
767 767
768 bool BrokerAddTargetPeer(HANDLE peer_process) { 768 bool BrokerAddTargetPeer(HANDLE peer_process) {
769 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; 769 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK;
770 } 770 }
771 771
772 } // namespace content 772 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | win8/delegate_execute/command_execute_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698