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

Issue 1054243002: Avoid calling the GetSystemMetrics API in the renderer process on Windows to get the scrollbar metr… (Closed)

Created:
5 years, 8 months ago by ananta
Modified:
5 years, 8 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, nasko+codewatch_chromium.org, jam, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid calling the GetSystemMetrics API in the renderer process on Windows to get the scrollbar metrics. It appears that this call takes a long time on certain Windows 8 configurations because the call triggers a load of the uxtheme.dll which fails and retries every time. This is presumably due to the Win32K lockdown mode on Windows 8+. Fix is to send the scrollbar metrics values we are interested in as part of the RendererPrefs structure. In the renderer these are saved as static values in the WebThemeEngineImpl class. 1) Note that not all of the cache settings are currently used - SM_CYHSCROLL, SM_CYVSCROLL, and SM_CXHSCROLL are cached for possible future usage. 2. These repeated attempts to load uxtheme.dll only occur in some (ill-defined) situations, having to do with what theme is selected and other factors BUG=472790 Committed: https://crrev.com/59b9fe7ebc4c814410f1ac4a0c5a7cecb125ce81 Cr-Commit-Position: refs/heads/master@{#323999}

Patch Set 1 #

Total comments: 19

Patch Set 2 : Address review comments #

Patch Set 3 : Revert changes to web_contents_impl.cc #

Patch Set 4 : Removed unnecessary include #

Total comments: 2

Patch Set 5 : #

Total comments: 4

Patch Set 6 : Address cpu review comments #

Patch Set 7 : Fix presubmit #

Patch Set 8 : Fix build error #

Patch Set 9 : Fix build error #

Patch Set 10 : Fix build error #

Patch Set 11 : Fix build error in view_messages #

Unified diffs Side-by-side diffs Delta from patch set Stats (+153 lines, -40 lines) Patch
M chrome/browser/renderer_preferences_util.cc View 1 2 3 4 2 chunks +0 lines, -30 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.cc View 1 3 chunks +39 lines, -0 lines 0 comments Download
M content/child/webthemeengine_impl_default.h View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M content/child/webthemeengine_impl_default.cc View 1 2 3 4 5 6 7 3 chunks +54 lines, -3 lines 0 comments Download
M content/common/view_messages.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -1 line 0 comments Download
M content/public/common/renderer_preferences.h View 1 2 3 4 5 6 7 8 9 2 chunks +17 lines, -2 lines 0 comments Download
M content/public/common/renderer_preferences.cc View 1 2 3 4 5 6 1 chunk +10 lines, -4 lines 0 comments Download
M content/renderer/render_view_impl.h View 1 chunk +7 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/render_view_win.cc View 1 2 3 4 5 2 chunks +9 lines, -0 lines 0 comments Download

Messages

Total messages: 44 (19 generated)
ananta
5 years, 8 months ago (2015-04-02 22:46:33 UTC) #2
jam
which parts do you want each of us to look at? cpu is owner for ...
5 years, 8 months ago (2015-04-03 00:35:46 UTC) #3
ananta
On 2015/04/03 00:35:46, jam wrote: > which parts do you want each of us to ...
5 years, 8 months ago (2015-04-03 00:59:00 UTC) #4
cpu_(ooo_6.6-7.5)
bruce, can you do a first pass reivew? thanks
5 years, 8 months ago (2015-04-03 01:06:49 UTC) #6
jam
https://codereview.chromium.org/1054243002/diff/1/chrome/browser/renderer_preferences_util.cc File chrome/browser/renderer_preferences_util.cc (right): https://codereview.chromium.org/1054243002/diff/1/chrome/browser/renderer_preferences_util.cc#newcode157 chrome/browser/renderer_preferences_util.cc:157: gfx::win::GetSystemMetricsInDIP(SM_CXHSCROLL); seems this should be done in content layer ...
5 years, 8 months ago (2015-04-03 15:08:20 UTC) #7
brucedawson
Suggested addition to description: These repeated attempts to load uxtheme.dll only occur in some (ill-defined) ...
5 years, 8 months ago (2015-04-03 17:00:24 UTC) #8
ananta
https://codereview.chromium.org/1054243002/diff/1/chrome/browser/renderer_preferences_util.cc File chrome/browser/renderer_preferences_util.cc (right): https://codereview.chromium.org/1054243002/diff/1/chrome/browser/renderer_preferences_util.cc#newcode152 chrome/browser/renderer_preferences_util.cc:152: prefs->horizontal_scroll_bar_height_in_dips = On 2015/04/03 17:00:24, brucedawson wrote: > When ...
5 years, 8 months ago (2015-04-03 19:17:04 UTC) #9
jam
lgtm
5 years, 8 months ago (2015-04-03 19:26:34 UTC) #10
brucedawson
lgtm, with one nit and one request/question: It would be good to add a couple ...
5 years, 8 months ago (2015-04-03 19:42:17 UTC) #11
ananta
Updated the patch set as per bruce's suggestion. https://codereview.chromium.org/1054243002/diff/60001/chrome/browser/renderer_preferences_util.cc File chrome/browser/renderer_preferences_util.cc (right): https://codereview.chromium.org/1054243002/diff/60001/chrome/browser/renderer_preferences_util.cc#newcode37 chrome/browser/renderer_preferences_util.cc:37: #include ...
5 years, 8 months ago (2015-04-03 20:16:33 UTC) #12
jschuh
ipc security lgtm. (notes: browser -> renderer integers)
5 years, 8 months ago (2015-04-03 20:49:15 UTC) #13
cpu_(ooo_6.6-7.5)
lgtm w/ nits https://codereview.chromium.org/1054243002/diff/80001/content/child/webthemeengine_impl_default.h File content/child/webthemeengine_impl_default.h (right): https://codereview.chromium.org/1054243002/diff/80001/content/child/webthemeengine_impl_default.h#newcode31 content/child/webthemeengine_impl_default.h:31: static void CacheScrollBarMetrics(int32 vertical_scroll_bar_width, looks like ...
5 years, 8 months ago (2015-04-06 20:22:08 UTC) #14
ananta
https://codereview.chromium.org/1054243002/diff/80001/content/child/webthemeengine_impl_default.h File content/child/webthemeengine_impl_default.h (right): https://codereview.chromium.org/1054243002/diff/80001/content/child/webthemeengine_impl_default.h#newcode31 content/child/webthemeengine_impl_default.h:31: static void CacheScrollBarMetrics(int32 vertical_scroll_bar_width, On 2015/04/06 20:22:08, cpu wrote: ...
5 years, 8 months ago (2015-04-06 20:42:03 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1054243002/100001
5 years, 8 months ago (2015-04-06 20:43:21 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/54355)
5 years, 8 months ago (2015-04-06 20:53:45 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1054243002/120001
5 years, 8 months ago (2015-04-06 21:58:16 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_dbg on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_dbg/builds/58881)
5 years, 8 months ago (2015-04-06 22:12:57 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1054243002/140001
5 years, 8 months ago (2015-04-06 22:40:56 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/75577)
5 years, 8 months ago (2015-04-06 22:56:48 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1054243002/160001
5 years, 8 months ago (2015-04-06 23:37:10 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1054243002/180001
5 years, 8 months ago (2015-04-06 23:49:50 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/75601)
5 years, 8 months ago (2015-04-07 00:09:47 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1054243002/200001
5 years, 8 months ago (2015-04-07 00:38:28 UTC) #42
commit-bot: I haz the power
Committed patchset #11 (id:200001)
5 years, 8 months ago (2015-04-07 01:33:42 UTC) #43
commit-bot: I haz the power
5 years, 8 months ago (2015-04-07 01:34:29 UTC) #44
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/59b9fe7ebc4c814410f1ac4a0c5a7cecb125ce81
Cr-Commit-Position: refs/heads/master@{#323999}

Powered by Google App Engine
This is Rietveld 408576698