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

Issue 1560573002: Reduce infobar lag on KitKat from 1000ms to 100ms. (Closed)

Created:
4 years, 11 months ago by newt (away)
Modified:
4 years, 11 months ago
Reviewers:
gone
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Reduce infobar lag on KitKat from 1000ms to 100ms. This fixes four compounding inefficiencies that caused infobar layouts to take waaaay longer than they should have (over 1 second in the direst cases!). The worst manifestation of this problem could be seen by opening the change-language panel on the translate infobar on a pre-L device. This resulted in 3 300ms measures as well as 250ms spent measuring text. The fixes are: - InfoBarLayout was measuring each InfoBarControlLayout twice: once with UNSPECIFIED width and once with an exact width. Since InfoBarControlLayouts handle layout logic internally, they should only be measured once, with an exact width. - The infobar view's width was WRAP_CONTENT, which caused its parent, the wrapper view, to measure it twice. This is fixed by setting the width to MATCH_PARENT. - TranslateLanguagePanel.onItemSelected() is called twice when the translate panel is first created to set the initial values of the spinners. This resulted in two superfluous measure/layout/draw passes. As a fix, TranslateLanguagePanel.onItemSelected() only calls reloadSpinners() if the selected language has actually changed. - TranslateLanguagePanel.setUpSpinners() took 250ms to determine the width of the longest language. This CL makes this measuring logic smarter and avoids redundant work in two different ways: it only measures each language once (not once per spinner), and it only measures "Page language: " and "Translation language: " once. (instead of once per language per spinner = ~140 times each) BUG=564406 Committed: https://crrev.com/6e4b88e29b0968427fdaa5e70307a10845409452 Cr-Commit-Position: refs/heads/master@{#367464}

Patch Set 1 #

Patch Set 2 : appease the FindBugs gods #

Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -66 lines) Patch
D chrome/android/java/res/layout/infobar_text.xml View 1 chunk +0 lines, -14 lines 0 comments Download
M chrome/android/java/res/layout/infobar_wrapper.xml View 1 chunk +1 line, -5 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainerLayout.java View 5 chunks +12 lines, -3 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarLayout.java View 3 chunks +5 lines, -4 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateLanguagePanel.java View 1 5 chunks +38 lines, -40 lines 0 comments Download

Messages

Total messages: 13 (6 generated)
newt (away)
PTAL
4 years, 11 months ago (2016-01-05 00:20:05 UTC) #2
gone
lgtm
4 years, 11 months ago (2016-01-05 00:41:53 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1560573002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1560573002/1
4 years, 11 months ago (2016-01-05 00:42:51 UTC) #5
commit-bot: I haz the power
Try jobs failed on following builders: android_clang_dbg_recipe on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clang_dbg_recipe/builds/3739)
4 years, 11 months ago (2016-01-05 01:46:51 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1560573002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1560573002/20001
4 years, 11 months ago (2016-01-05 02:06:27 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 11 months ago (2016-01-05 02:44:01 UTC) #11
commit-bot: I haz the power
4 years, 11 months ago (2016-01-05 02:45:39 UTC) #13
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/6e4b88e29b0968427fdaa5e70307a10845409452
Cr-Commit-Position: refs/heads/master@{#367464}

Powered by Google App Engine
This is Rietveld 408576698