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

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

Issue 1557513002: Add logic to switch to DirectWrite font proxy via field trial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months 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
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 #if !defined(NACL_WIN64) 728 #if !defined(NACL_WIN64)
729 if (type_str == switches::kRendererProcess || 729 if (type_str == switches::kRendererProcess ||
730 type_str == switches::kPpapiPluginProcess) { 730 type_str == switches::kPpapiPluginProcess) {
731 if (gfx::win::ShouldUseDirectWrite()) { 731 if (gfx::win::ShouldUseDirectWrite()) {
732 AddDirectory(base::DIR_WINDOWS_FONTS, 732 AddDirectory(base::DIR_WINDOWS_FONTS,
733 NULL, 733 NULL,
734 true, 734 true,
735 sandbox::TargetPolicy::FILES_ALLOW_READONLY, 735 sandbox::TargetPolicy::FILES_ALLOW_READONLY,
736 policy); 736 policy);
737 737
738 // If DirectWrite is enabled for font rendering then open the font cache 738 if (content::ShouldUseDirectWriteFontProxyFieldTrial()) {
fdoray 2015/12/30 01:15:08 if (!...)
Ilya Kulshin 2015/12/30 01:59:46 Done.
739 // section which is created by the browser and pass the handle to the 739 // If DirectWrite is enabled for font rendering then open the font
740 // renderer process. This is needed because renderer processes on 740 // cache section which is created by the browser and pass the handle to
741 // Windows 8+ may be running in an AppContainer sandbox and hence their 741 // the renderer process. This is needed because renderer processes on
742 // kernel object namespace may be partitioned. 742 // Windows 8+ may be running in an AppContainer sandbox and hence their
743 std::string name(content::kFontCacheSharedSectionName); 743 // kernel object namespace may be partitioned.
744 name.append(base::UintToString(base::GetCurrentProcId())); 744 std::string name(content::kFontCacheSharedSectionName);
745 name.append(base::UintToString(base::GetCurrentProcId()));
745 746
746 base::SharedMemory direct_write_font_cache_section; 747 base::SharedMemory direct_write_font_cache_section;
747 if (direct_write_font_cache_section.Open(name, true)) { 748 if (direct_write_font_cache_section.Open(name, true)) {
748 void* shared_handle = policy->AddHandleToShare( 749 void* shared_handle = policy->AddHandleToShare(
749 direct_write_font_cache_section.handle().GetHandle()); 750 direct_write_font_cache_section.handle().GetHandle());
750 cmd_line->AppendSwitchASCII( 751 cmd_line->AppendSwitchASCII(
751 switches::kFontCacheSharedHandle, 752 switches::kFontCacheSharedHandle,
752 base::UintToString(base::win::HandleToUint32(shared_handle))); 753 base::UintToString(base::win::HandleToUint32(shared_handle)));
754 }
753 } 755 }
754 } 756 }
755 } 757 }
756 #endif 758 #endif
757 759
758 if (type_str != switches::kRendererProcess) { 760 if (type_str != switches::kRendererProcess) {
759 // Hack for Google Desktop crash. Trick GD into not injecting its DLL into 761 // Hack for Google Desktop crash. Trick GD into not injecting its DLL into
760 // this subprocess. See 762 // this subprocess. See
761 // http://code.google.com/p/chromium/issues/detail?id=25580 763 // http://code.google.com/p/chromium/issues/detail?id=25580
762 cmd_line->AppendSwitchASCII("ignored", " --type=renderer "); 764 cmd_line->AppendSwitchASCII("ignored", " --type=renderer ");
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 } 856 }
855 857
856 return false; 858 return false;
857 } 859 }
858 860
859 bool BrokerAddTargetPeer(HANDLE peer_process) { 861 bool BrokerAddTargetPeer(HANDLE peer_process) {
860 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; 862 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK;
861 } 863 }
862 864
863 } // namespace content 865 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698