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

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

Issue 1320783002: Make SharedMemoryHandle a class on windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ipc_global
Patch Set: Fix DCHECK. Created 5 years, 2 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 <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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 // If DirectWrite is enabled for font rendering then open the font cache 721 // If DirectWrite is enabled for font rendering then open the font cache
722 // section which is created by the browser and pass the handle to the 722 // section which is created by the browser and pass the handle to the
723 // renderer process. This is needed because renderer processes on 723 // renderer process. This is needed because renderer processes on
724 // Windows 8+ may be running in an AppContainer sandbox and hence their 724 // Windows 8+ may be running in an AppContainer sandbox and hence their
725 // kernel object namespace may be partitioned. 725 // kernel object namespace may be partitioned.
726 std::string name(content::kFontCacheSharedSectionName); 726 std::string name(content::kFontCacheSharedSectionName);
727 name.append(base::UintToString(base::GetCurrentProcId())); 727 name.append(base::UintToString(base::GetCurrentProcId()));
728 728
729 base::SharedMemory direct_write_font_cache_section; 729 base::SharedMemory direct_write_font_cache_section;
730 if (direct_write_font_cache_section.Open(name, true)) { 730 if (direct_write_font_cache_section.Open(name, true)) {
731 void* shared_handle = 731 void* shared_handle = policy->AddHandleToShare(
732 policy->AddHandleToShare(direct_write_font_cache_section.handle()); 732 direct_write_font_cache_section.handle().GetHandle());
733 cmd_line->AppendSwitchASCII(switches::kFontCacheSharedHandle, 733 cmd_line->AppendSwitchASCII(switches::kFontCacheSharedHandle,
734 base::UintToString(reinterpret_cast<unsigned int>(shared_handle))); 734 base::UintToString(reinterpret_cast<unsigned int>(shared_handle)));
735 } 735 }
736 } 736 }
737 #endif 737 #endif
738 } else { 738 } else {
739 // Hack for Google Desktop crash. Trick GD into not injecting its DLL into 739 // Hack for Google Desktop crash. Trick GD into not injecting its DLL into
740 // this subprocess. See 740 // this subprocess. See
741 // http://code.google.com/p/chromium/issues/detail?id=25580 741 // http://code.google.com/p/chromium/issues/detail?id=25580
742 cmd_line->AppendSwitchASCII("ignored", " --type=renderer "); 742 cmd_line->AppendSwitchASCII("ignored", " --type=renderer ");
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 } 860 }
861 861
862 return false; 862 return false;
863 } 863 }
864 864
865 bool BrokerAddTargetPeer(HANDLE peer_process) { 865 bool BrokerAddTargetPeer(HANDLE peer_process) {
866 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; 866 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK;
867 } 867 }
868 868
869 } // namespace content 869 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698