| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 | 688 |
| 689 base::HandlesToInheritVector handles = handles_to_inherit; | 689 base::HandlesToInheritVector handles = handles_to_inherit; |
| 690 if (!handles_to_inherit.empty()) { | 690 if (!handles_to_inherit.empty()) { |
| 691 options.inherit_handles = true; | 691 options.inherit_handles = true; |
| 692 options.handles_to_inherit = &handles; | 692 options.handles_to_inherit = &handles; |
| 693 } | 693 } |
| 694 base::Process process = base::LaunchProcess(*cmd_line, options); | 694 base::Process process = base::LaunchProcess(*cmd_line, options); |
| 695 | 695 |
| 696 // TODO(rvargas) crbug.com/417532: Don't share a raw handle. | 696 // TODO(rvargas) crbug.com/417532: Don't share a raw handle. |
| 697 g_broker_services->AddTargetPeer(process.Handle()); | 697 g_broker_services->AddTargetPeer(process.Handle()); |
| 698 return process.Pass(); | 698 return process; |
| 699 } | 699 } |
| 700 | 700 |
| 701 sandbox::TargetPolicy* policy = g_broker_services->CreatePolicy(); | 701 sandbox::TargetPolicy* policy = g_broker_services->CreatePolicy(); |
| 702 | 702 |
| 703 // Add any handles to be inherited to the policy. | 703 // Add any handles to be inherited to the policy. |
| 704 for (HANDLE handle : handles_to_inherit) | 704 for (HANDLE handle : handles_to_inherit) |
| 705 policy->AddHandleToShare(handle); | 705 policy->AddHandleToShare(handle); |
| 706 | 706 |
| 707 // Pre-startup mitigations. | 707 // Pre-startup mitigations. |
| 708 sandbox::MitigationFlags mitigations = | 708 sandbox::MitigationFlags mitigations = |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 } | 878 } |
| 879 | 879 |
| 880 return false; | 880 return false; |
| 881 } | 881 } |
| 882 | 882 |
| 883 bool BrokerAddTargetPeer(HANDLE peer_process) { | 883 bool BrokerAddTargetPeer(HANDLE peer_process) { |
| 884 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; | 884 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; |
| 885 } | 885 } |
| 886 | 886 |
| 887 } // namespace content | 887 } // namespace content |
| OLD | NEW |