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

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

Issue 209163002: Support DirectWrite with sandbox on (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 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 | Annotate | Revision Log
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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 delegate->PreSandbox(&disable_default_policy, &exposed_dir); 635 delegate->PreSandbox(&disable_default_policy, &exposed_dir);
636 636
637 if (!disable_default_policy && !AddPolicyForSandboxedProcess(policy)) 637 if (!disable_default_policy && !AddPolicyForSandboxedProcess(policy))
638 return 0; 638 return 0;
639 639
640 if (type_str != switches::kRendererProcess) { 640 if (type_str != switches::kRendererProcess) {
641 // Hack for Google Desktop crash. Trick GD into not injecting its DLL into 641 // Hack for Google Desktop crash. Trick GD into not injecting its DLL into
642 // this subprocess. See 642 // this subprocess. See
643 // http://code.google.com/p/chromium/issues/detail?id=25580 643 // http://code.google.com/p/chromium/issues/detail?id=25580
644 cmd_line->AppendSwitchASCII("ignored", " --type=renderer "); 644 cmd_line->AppendSwitchASCII("ignored", " --type=renderer ");
645 } else {
646 AddDirectory(base::DIR_WINDOWS_FONTS,
jschuh 2014/03/25 04:03:48 This should be scoped to only when DW is enabled.
647 NULL,
648 true,
649 sandbox::TargetPolicy::FILES_ALLOW_READONLY,
650 policy);
645 } 651 }
646 652
647 sandbox::ResultCode result; 653 sandbox::ResultCode result;
648 if (!exposed_dir.empty()) { 654 if (!exposed_dir.empty()) {
649 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, 655 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES,
650 sandbox::TargetPolicy::FILES_ALLOW_ANY, 656 sandbox::TargetPolicy::FILES_ALLOW_ANY,
651 exposed_dir.value().c_str()); 657 exposed_dir.value().c_str());
652 if (result != sandbox::SBOX_ALL_OK) 658 if (result != sandbox::SBOX_ALL_OK)
653 return 0; 659 return 0;
654 660
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 } 750 }
745 751
746 return false; 752 return false;
747 } 753 }
748 754
749 bool BrokerAddTargetPeer(HANDLE peer_process) { 755 bool BrokerAddTargetPeer(HANDLE peer_process) {
750 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; 756 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK;
751 } 757 }
752 758
753 } // namespace content 759 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698