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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 base::string16 object_path = PrependWindowsSessionPath( | 574 base::string16 object_path = PrependWindowsSessionPath( |
575 L"\\BaseNamedObjects\\windows_shell_global_counters"); | 575 L"\\BaseNamedObjects\\windows_shell_global_counters"); |
576 policy->AddKernelObjectToClose(L"Section", object_path.data()); | 576 policy->AddKernelObjectToClose(L"Section", object_path.data()); |
577 } | 577 } |
578 | 578 |
579 void AddAppContainerPolicy(sandbox::TargetPolicy* policy, const wchar_t* sid) { | 579 void AddAppContainerPolicy(sandbox::TargetPolicy* policy, const wchar_t* sid) { |
580 if (base::win::GetVersion() == base::win::VERSION_WIN8 || | 580 if (base::win::GetVersion() == base::win::VERSION_WIN8 || |
581 base::win::GetVersion() == base::win::VERSION_WIN8_1) { | 581 base::win::GetVersion() == base::win::VERSION_WIN8_1) { |
582 const base::CommandLine& command_line = | 582 const base::CommandLine& command_line = |
583 *base::CommandLine::ForCurrentProcess(); | 583 *base::CommandLine::ForCurrentProcess(); |
584 if (!command_line.HasSwitch(switches::kDisableAppContainer)) { | 584 if (command_line.HasSwitch(switches::kEnableAppContainer)) { |
585 policy->SetLowBox(sid); | 585 policy->SetLowBox(sid); |
586 } | 586 } |
587 } | 587 } |
588 } | 588 } |
589 | 589 |
590 bool InitBrokerServices(sandbox::BrokerServices* broker_services) { | 590 bool InitBrokerServices(sandbox::BrokerServices* broker_services) { |
591 // TODO(abarth): DCHECK(CalledOnValidThread()); | 591 // TODO(abarth): DCHECK(CalledOnValidThread()); |
592 // See <http://b/1287166>. | 592 // See <http://b/1287166>. |
593 DCHECK(broker_services); | 593 DCHECK(broker_services); |
594 DCHECK(!g_broker_services); | 594 DCHECK(!g_broker_services); |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 } | 845 } |
846 | 846 |
847 return false; | 847 return false; |
848 } | 848 } |
849 | 849 |
850 bool BrokerAddTargetPeer(HANDLE peer_process) { | 850 bool BrokerAddTargetPeer(HANDLE peer_process) { |
851 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; | 851 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; |
852 } | 852 } |
853 | 853 |
854 } // namespace content | 854 } // namespace content |
OLD | NEW |