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

Unified Diff: content/common/content_switches_internal.cc

Issue 872673002: Do not use win32k renderer lockdown if DirectWrite is disabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move IsWin32kRendererLockdownEnabled to content/common Created 5 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 side-by-side diff with in-line comments
Download patch
Index: content/common/content_switches_internal.cc
diff --git a/content/common/content_switches_internal.cc b/content/common/content_switches_internal.cc
index 76d877224a4ef9d076cf8bfe0f0b7d498a18d57e..68b24c477078bce0bc060276cbf74758908a651d 100644
--- a/content/common/content_switches_internal.cc
+++ b/content/common/content_switches_internal.cc
@@ -5,10 +5,12 @@
#include "content/common/content_switches_internal.h"
#include "base/command_line.h"
+#include "base/metrics/field_trial.h"
#include "content/public/common/content_switches.h"
#if defined(OS_WIN)
#include "base/win/windows_version.h"
+#include "ui/gfx/win/direct_write.h"
#endif
namespace content {
@@ -31,4 +33,23 @@ bool IsPinchToZoomEnabled() {
#endif
}
+#if defined(OS_WIN)
+
+bool IsWin32kRendererLockdownEnabled() {
+ const std::string group_name =
+ base::FieldTrialList::FindFullName("Win32kLockdown");
+ if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ return false;
+ if (!gfx::win::ShouldUseDirectWrite())
+ return false;
+ const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kEnableWin32kRendererLockDown))
+ return true;
+ if (cmd_line->HasSwitch(switches::kDisableWin32kRendererLockDown))
+ return false;
+ // Default.
+ return group_name == "Enabled";
+}
+#endif
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698