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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 name.append(base::UintToString(base::GetCurrentProcId())); | 705 name.append(base::UintToString(base::GetCurrentProcId())); |
706 | 706 |
707 base::SharedMemory direct_write_font_cache_section; | 707 base::SharedMemory direct_write_font_cache_section; |
708 if (direct_write_font_cache_section.Open(name, true)) { | 708 if (direct_write_font_cache_section.Open(name, true)) { |
709 void* shared_handle = | 709 void* shared_handle = |
710 policy->AddHandleToShare(direct_write_font_cache_section.handle()); | 710 policy->AddHandleToShare(direct_write_font_cache_section.handle()); |
711 cmd_line->AppendSwitchASCII(switches::kFontCacheSharedHandle, | 711 cmd_line->AppendSwitchASCII(switches::kFontCacheSharedHandle, |
712 base::UintToString(reinterpret_cast<unsigned int>(shared_handle))); | 712 base::UintToString(reinterpret_cast<unsigned int>(shared_handle))); |
713 } | 713 } |
714 } | 714 } |
| 715 if (policy->AddRule(sandbox::TargetPolicy::SUBSYS_LPC, |
| 716 sandbox::TargetPolicy::ALPC_CONNECT_ALLOW, |
| 717 L"*") != sandbox::SBOX_ALL_OK) { |
| 718 return base::Process(); |
| 719 } |
715 #endif | 720 #endif |
716 } else { | 721 } else { |
717 // Hack for Google Desktop crash. Trick GD into not injecting its DLL into | 722 // Hack for Google Desktop crash. Trick GD into not injecting its DLL into |
718 // this subprocess. See | 723 // this subprocess. See |
719 // http://code.google.com/p/chromium/issues/detail?id=25580 | 724 // http://code.google.com/p/chromium/issues/detail?id=25580 |
720 cmd_line->AppendSwitchASCII("ignored", " --type=renderer "); | 725 cmd_line->AppendSwitchASCII("ignored", " --type=renderer "); |
721 } | 726 } |
722 | 727 |
723 sandbox::ResultCode result; | 728 sandbox::ResultCode result; |
724 if (!exposed_dir.empty()) { | 729 if (!exposed_dir.empty()) { |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 } | 832 } |
828 | 833 |
829 return false; | 834 return false; |
830 } | 835 } |
831 | 836 |
832 bool BrokerAddTargetPeer(HANDLE peer_process) { | 837 bool BrokerAddTargetPeer(HANDLE peer_process) { |
833 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; | 838 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; |
834 } | 839 } |
835 | 840 |
836 } // namespace content | 841 } // namespace content |
OLD | NEW |