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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 // If DirectWrite is enabled for font rendering then open the font cache | 722 // If DirectWrite is enabled for font rendering then open the font cache |
723 // section which is created by the browser and pass the handle to the | 723 // section which is created by the browser and pass the handle to the |
724 // renderer process. This is needed because renderer processes on | 724 // renderer process. This is needed because renderer processes on |
725 // Windows 8+ may be running in an AppContainer sandbox and hence their | 725 // Windows 8+ may be running in an AppContainer sandbox and hence their |
726 // kernel object namespace may be partitioned. | 726 // kernel object namespace may be partitioned. |
727 std::string name(content::kFontCacheSharedSectionName); | 727 std::string name(content::kFontCacheSharedSectionName); |
728 name.append(base::UintToString(base::GetCurrentProcId())); | 728 name.append(base::UintToString(base::GetCurrentProcId())); |
729 | 729 |
730 base::SharedMemory direct_write_font_cache_section; | 730 base::SharedMemory direct_write_font_cache_section; |
731 if (direct_write_font_cache_section.Open(name, true)) { | 731 if (direct_write_font_cache_section.Open(name, true)) { |
732 void* shared_handle = | 732 void* shared_handle = policy->AddHandleToShare( |
733 policy->AddHandleToShare(direct_write_font_cache_section.handle()); | 733 direct_write_font_cache_section.handle().GetHandle()); |
734 cmd_line->AppendSwitchASCII(switches::kFontCacheSharedHandle, | 734 cmd_line->AppendSwitchASCII(switches::kFontCacheSharedHandle, |
735 base::UintToString(reinterpret_cast<unsigned int>(shared_handle))); | 735 base::UintToString(reinterpret_cast<unsigned int>(shared_handle))); |
736 } | 736 } |
737 } | 737 } |
738 } | 738 } |
739 #endif | 739 #endif |
740 | 740 |
741 if (type_str != switches::kRendererProcess) { | 741 if (type_str != switches::kRendererProcess) { |
742 // Hack for Google Desktop crash. Trick GD into not injecting its DLL into | 742 // Hack for Google Desktop crash. Trick GD into not injecting its DLL into |
743 // this subprocess. See | 743 // this subprocess. See |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 } | 863 } |
864 | 864 |
865 return false; | 865 return false; |
866 } | 866 } |
867 | 867 |
868 bool BrokerAddTargetPeer(HANDLE peer_process) { | 868 bool BrokerAddTargetPeer(HANDLE peer_process) { |
869 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; | 869 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; |
870 } | 870 } |
871 | 871 |
872 } // namespace content | 872 } // namespace content |
OLD | NEW |