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

Issue 544173007: Avoid repeatedly deriving fonts in the LabelButton ctor. (Closed)

Created:
6 years, 3 months ago by msw
Modified:
6 years, 3 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Avoid repeatedly deriving fonts in the LabelButton ctor. Create LazyInstances for the default LabelButton FontLists. Avoid creating/deriving default fonts for each new button. (the bookmark bar can create unbounded button instances) (repeated derivation is slow and exhausts GDI handles) BUG=411716 TEST=Profiles with tons of bookmarks do not crash. R=sky@chromium.org Committed: https://crrev.com/753f06ff55b91b8ff39352e8bf87cbbbd2d695f4 Cr-Commit-Position: refs/heads/master@{#294955}

Patch Set 1 #

Patch Set 2 : Set Label FontList in LabelButton ctor. #

Total comments: 2

Patch Set 3 : Use LazyInstance to avoid non-POD statics. #

Patch Set 4 : Add bold styling DCHECK warning against repeated derive calls. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -1 line) Patch
M ui/views/controls/button/label_button.cc View 1 2 3 4 chunks +21 lines, -1 line 0 comments Download

Messages

Total messages: 8 (2 generated)
sky
https://codereview.chromium.org/544173007/diff/20001/ui/views/controls/button/label_button.cc File ui/views/controls/button/label_button.cc (right): https://codereview.chromium.org/544173007/diff/20001/ui/views/controls/button/label_button.cc#newcode34 ui/views/controls/button/label_button.cc:34: static const gfx::FontList kNormalFontList = gfx::FontList(); Style guide says ...
6 years, 3 months ago (2014-09-15 19:15:34 UTC) #2
msw
Please take another look, thanks! https://codereview.chromium.org/544173007/diff/20001/ui/views/controls/button/label_button.cc File ui/views/controls/button/label_button.cc (right): https://codereview.chromium.org/544173007/diff/20001/ui/views/controls/button/label_button.cc#newcode34 ui/views/controls/button/label_button.cc:34: static const gfx::FontList kNormalFontList ...
6 years, 3 months ago (2014-09-15 20:51:42 UTC) #3
sky
LGTM
6 years, 3 months ago (2014-09-15 21:39:01 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/544173007/60001
6 years, 3 months ago (2014-09-15 23:32:21 UTC) #6
commit-bot: I haz the power
Committed patchset #4 (id:60001) as a340f8846f8247e06ef4675a12d7af49ea302a38
6 years, 3 months ago (2014-09-16 01:04:08 UTC) #7
commit-bot: I haz the power
6 years, 3 months ago (2014-09-16 01:06:56 UTC) #8
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/753f06ff55b91b8ff39352e8bf87cbbbd2d695f4
Cr-Commit-Position: refs/heads/master@{#294955}

Powered by Google App Engine
This is Rietveld 408576698