Index: content/common/sandbox_win.cc |
diff --git a/content/common/sandbox_win.cc b/content/common/sandbox_win.cc |
index aea586054e51329e97627abc203ac3cfdb7f2b06..9876571ebb2a3d6a1f87e75c3dbb77b851d9878e 100644 |
--- a/content/common/sandbox_win.cc |
+++ b/content/common/sandbox_win.cc |
@@ -571,6 +571,16 @@ bool InitTargetServices(sandbox::TargetServices* target_services) { |
return sandbox::SBOX_ALL_OK == result; |
} |
+bool ShouldUseDirectWrite() { |
+ // If the flag is currently on, and we're on Win7 or above, we enable |
+ // DirectWrite. Skia does not require the additions to DirectWrite |
+ // in QFE 2670838, so a Win7 check is sufficient. We don't not currently |
+ // attempt to support Vista, where SP2 and the Platform Update are required. |
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
+ return command_line.HasSwitch(switches::kEnableDirectWrite) && |
+ base::win::GetVersion() >= base::win::VERSION_WIN7; |
+} |
+ |
base::ProcessHandle StartSandboxedProcess( |
SandboxedProcessLauncherDelegate* delegate, |
CommandLine* cmd_line) { |
@@ -642,6 +652,16 @@ base::ProcessHandle StartSandboxedProcess( |
// this subprocess. See |
// http://code.google.com/p/chromium/issues/detail?id=25580 |
cmd_line->AppendSwitchASCII("ignored", " --type=renderer "); |
+ } else if (ShouldUseDirectWrite()) { |
jam
2014/03/25 22:57:26
nit: it would be clearer to have if (type_str == r
scottmg
2014/03/25 23:38:18
Done.
|
+ AddDirectory(base::DIR_WINDOWS_FONTS, |
+ NULL, |
+ true, |
+ sandbox::TargetPolicy::FILES_ALLOW_READONLY, |
+ policy); |
+ // We do not automatically propagate this from the browser command line, |
+ // and instead only add it when we're actually setting up the sandbox to |
+ // work with DirectWrite. |
+ cmd_line->AppendSwitch(switches::kEnableDirectWrite); |
} |
sandbox::ResultCode result; |