From 945de9d8719f3a61e5fca9ecaff8e740a4432ae1 Mon Sep 17 00:00:00 2001 From: wfh Date: Wed, 13 May 2015 11:47:46 -0700 Subject: [PATCH] Remove Win32k fieldtrial, flag and switches, and make default enabled. Since the default is now always enabled, remove the test that specifically tests renderers can operate with the switch enabled. BUG=365160 Review URL: https://codereview.chromium.org/1133243003 Cr-Commit-Position: refs/heads/master@{#329684} --- chrome/app/generated_resources.grd | 6 ---- chrome/browser/about_flags.cc | 8 ----- .../render_process_host_browsertest.cc | 37 ---------------------- .../renderer_host/render_process_host_impl.cc | 1 - content/common/content_switches_internal.cc | 7 +--- content/public/common/content_switches.cc | 6 +--- content/public/common/content_switches.h | 3 -- 7 files changed, 2 insertions(+), 66 deletions(-) diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 7b438542378e..511494e9db58 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -5776,12 +5776,6 @@ Keep your key file in a safe place. You will need it to create new versions of y Disables the use of experimental DirectWrite font rendering system. - - Enable win32k renderer lockdown - - - Enables the win32k renderer lockdown, which is only available on Windows 8 and above. - diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 6345ce4cb7d2..b7ce27d6fa14 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -570,14 +570,6 @@ const Experiment kExperiments[] = { kOsWin, SINGLE_VALUE_TYPE(switches::kDisableDirectWrite) }, - { - "enable-win32k-renderer-lockdown", - IDS_FLAGS_ENABLE_WIN32K_RENDERER_LOCKDOWN_NAME, - IDS_FLAGS_ENABLE_WIN32K_RENDERER_LOCKDOWN_DESCRIPTION, - kOsWin, - ENABLE_DISABLE_VALUE_TYPE(switches::kEnableWin32kRendererLockDown, - switches::kDisableWin32kRendererLockDown) - }, #endif { "enable-experimental-canvas-features", diff --git a/content/browser/renderer_host/render_process_host_browsertest.cc b/content/browser/renderer_host/render_process_host_browsertest.cc index 126d933ca5c1..99247b2cea5e 100644 --- a/content/browser/renderer_host/render_process_host_browsertest.cc +++ b/content/browser/renderer_host/render_process_host_browsertest.cc @@ -197,42 +197,5 @@ IN_PROC_BROWSER_TEST_F(RenderProcessHostTest, } } -#if defined(OS_WIN) -// Provides functionality to test renderer processes with the Win32K lockdown -// process mitigation. -class Win32KLockdownRendererProcessHostTest : public RenderProcessHostTest { - public: - Win32KLockdownRendererProcessHostTest() {} - - ~Win32KLockdownRendererProcessHostTest() override {} - - protected: - void SetUp() override { - base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); - command_line->AppendSwitch(switches::kEnableWin32kRendererLockDown); - RenderProcessHostTest::SetUp(); - } - - private: - DISALLOW_COPY_AND_ASSIGN(Win32KLockdownRendererProcessHostTest); -}; - -// Tests whether navigation requests with the Win32K lockdown mitigation set -// work correctly. -IN_PROC_BROWSER_TEST_F(Win32KLockdownRendererProcessHostTest, - RendererWin32KLockdownNavigationTest) { - if (base::win::GetVersion() < base::win::VERSION_WIN8) - return; - - ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); - - GURL test_url = embedded_test_server()->GetURL("/simple_page.html"); - NavigateToURL(shell(), test_url); - - EXPECT_EQ(1, RenderProcessHostCount()); - EXPECT_EQ(0, process_exits_); -} -#endif - } // namespace } // namespace content diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 8b0916a1c1d4..a7141e4fc77e 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -1372,7 +1372,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( #endif #if defined(OS_WIN) switches::kDisableDirectWrite, - switches::kEnableWin32kRendererLockDown, switches::kDisableWin32kRendererLockDown, switches::kTraceExportEventsToETW, #endif diff --git a/content/common/content_switches_internal.cc b/content/common/content_switches_internal.cc index 07d064e98eee..c13396ea3cac 100644 --- a/content/common/content_switches_internal.cc +++ b/content/common/content_switches_internal.cc @@ -50,8 +50,6 @@ void DisableWin32kRendererLockdown() { } bool IsWin32kRendererLockdownEnabled() { - const std::string group_name = - base::FieldTrialList::FindFullName("Win32kLockdown"); if (g_win32k_renderer_lockdown_disabled) return false; if (base::win::GetVersion() < base::win::VERSION_WIN8) @@ -59,12 +57,9 @@ bool IsWin32kRendererLockdownEnabled() { 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 != "Disabled"; + return true; } #endif diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index d9762104bad9..f86d9823424e 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -984,13 +984,9 @@ const char kDeviceScaleFactor[] = "device-scale-factor"; // Disable the Legacy Window which corresponds to the size of the WebContents. const char kDisableLegacyIntermediateWindow[] = "disable-legacy-window"; -// Enables or disables the Win32K process mitigation policy for renderer -// processes which prevents them from invoking user32 and gdi32 system calls -// which enter the kernel. This is only supported on Windows 8 and beyond. +// Disables the Win32K process mitigation policy for renderer processes. const char kDisableWin32kRendererLockDown[] = "disable-win32k-renderer-lockdown"; -const char kEnableWin32kRendererLockDown[] = - "enable-win32k-renderer-lockdown"; // DirectWrite FontCache is shared by browser to renderers using shared memory. // This switch allows us to pass the shared memory handle to the renderer. diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index 059255976df9..880d35ffdb18 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h @@ -291,10 +291,7 @@ extern const char kDisableThreadedEventHandlingMac[]; // like renderers, etc. CONTENT_EXPORT extern const char kDeviceScaleFactor[]; CONTENT_EXPORT extern const char kDisableLegacyIntermediateWindow[]; -// This switch will be removed when we enable the win32K lockdown process -// mitigation. CONTENT_EXPORT extern const char kDisableWin32kRendererLockDown[]; -CONTENT_EXPORT extern const char kEnableWin32kRendererLockDown[]; CONTENT_EXPORT extern const char kMemoryPressureThresholdsMb[]; // Switch to pass the font cache shared memory handle to the renderer. CONTENT_EXPORT extern const char kFontCacheSharedHandle[]; -- 2.11.4.GIT