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

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

Issue 342903002: Disable DirectWrite for pre-release versions of Windows 7 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 DCHECK(target_services); 559 DCHECK(target_services);
560 DCHECK(!g_target_services); 560 DCHECK(!g_target_services);
561 sandbox::ResultCode result = target_services->Init(); 561 sandbox::ResultCode result = target_services->Init();
562 g_target_services = target_services; 562 g_target_services = target_services;
563 return sandbox::SBOX_ALL_OK == result; 563 return sandbox::SBOX_ALL_OK == result;
564 } 564 }
565 565
566 bool ShouldUseDirectWrite() { 566 bool ShouldUseDirectWrite() {
567 // If the flag is currently on, and we're on Win7 or above, we enable 567 // If the flag is currently on, and we're on Win7 or above, we enable
568 // DirectWrite. Skia does not require the additions to DirectWrite in QFE 568 // DirectWrite. Skia does not require the additions to DirectWrite in QFE
569 // 2670838, so a Win7 check is sufficient. We do not currently attempt to 569 // 2670838, but a simple 'better than XP' check is not enough.
570 // support Vista, where SP2 and the Platform Update are required.
571 if (base::win::GetVersion() < base::win::VERSION_WIN7) 570 if (base::win::GetVersion() < base::win::VERSION_WIN7)
572 return false; 571 return false;
573 572
573 base::win::OSInfo::VersionNumber os_version =
574 base::win::OSInfo::GetInstance()->version_number();
575 if ((os_version.major == 6) && (os_version.minor == 1)) {
576 // We can't use DirectWrite for pre-release versions of Windows 7.
577 if (os_version.build < 7600)
578 return false;
579 }
580
574 // If forced off, don't use it. 581 // If forced off, don't use it.
575 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 582 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
576 if (command_line.HasSwitch(switches::kDisableDirectWrite)) 583 if (command_line.HasSwitch(switches::kDisableDirectWrite))
577 return false; 584 return false;
578 585
579 #if !defined(NACL_WIN64) 586 #if !defined(NACL_WIN64)
580 // Can't use GDI on HiDPI. 587 // Can't use GDI on HiDPI.
581 if (gfx::GetDPIScale() > 1.0f) 588 if (gfx::GetDPIScale() > 1.0f)
582 return true; 589 return true;
583 #endif 590 #endif
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 } 773 }
767 774
768 return false; 775 return false;
769 } 776 }
770 777
771 bool BrokerAddTargetPeer(HANDLE peer_process) { 778 bool BrokerAddTargetPeer(HANDLE peer_process) {
772 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; 779 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK;
773 } 780 }
774 781
775 } // namespace content 782 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698