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

Issue 11336008: When a font family pref changes to the empty string, pass it to WebKit. (Closed)

Created:
8 years, 1 month ago by falken
Modified:
8 years, 1 month ago
CC:
chromium-reviews, Aaron Boodman, chromium-apps-reviews_chromium.org, tfarina
Visibility:
Public.

Description

When a font family pref changes to the empty string, pass it to WebKit. The empty string means to fall back to the pref for the Common script ("Zyyy"). For example, if chrome.fonts.serif.Cyrl is the empty string, it means to use chrome.fonts.serif.Zyyy for Cyrillic script. Prefs that are the empty string are normally not passed to WebKit since there are so many of them that doing so would cause a perf regression (see r164050 and its revert r164294). Not passing the pref is normally okay since WebKit does the desired fallback behavior regardless of whether the empty string is passed or the pref is not passed at all. But if the pref has changed from non-empty to the empty string, we must let WebKit know. BUG=157558 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=165125

Patch Set 1 #

Patch Set 2 : revise comment #

Total comments: 2

Patch Set 3 : fix nit #

Total comments: 11

Patch Set 4 : review comments #

Patch Set 5 : add unit test #

Total comments: 11

Patch Set 6 : sync #

Patch Set 7 : review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+197 lines, -41 lines) Patch
M chrome/browser/extensions/api/font_settings/font_settings_api.cc View 1 2 3 4 5 4 chunks +3 lines, -18 lines 0 comments Download
M chrome/browser/ui/prefs/prefs_tab_helper.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/prefs/prefs_tab_helper.cc View 1 2 3 4 5 6 6 chunks +62 lines, -3 lines 0 comments Download
M chrome/chrome_common.gypi View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/pref_names.h View 1 2 3 4 5 2 chunks +7 lines, -5 lines 0 comments Download
M chrome/common/pref_names.cc View 1 2 3 3 chunks +18 lines, -15 lines 0 comments Download
A chrome/common/pref_names_util.h View 1 2 3 1 chunk +21 lines, -0 lines 0 comments Download
A chrome/common/pref_names_util.cc View 1 2 3 1 chunk +30 lines, -0 lines 0 comments Download
A chrome/common/pref_names_util_unittest.cc View 1 2 3 4 5 6 1 chunk +52 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
falken
Hi Tony, This is a different approach than http://codereview.chromium.org/11264006/ which caused a perf regression. I ...
8 years, 1 month ago (2012-10-29 11:54:28 UTC) #1
tony
LGTM. This doesn't seem too hacky to me. In the long run, we may want ...
8 years, 1 month ago (2012-10-29 18:13:52 UTC) #2
falken
Tony: thanks for the review. Adding OWNERS reviewers: thakis: chrome/ bauerb: prefs mpcomplete: extensions https://codereview.chromium.org/11336008/diff/2001/chrome/browser/extensions/api/font_settings/font_settings_api.cc ...
8 years, 1 month ago (2012-10-30 00:12:38 UTC) #3
tfarina
http://codereview.chromium.org/11336008/diff/3007/chrome/common/pref_names_util.h File chrome/common/pref_names_util.h (right): http://codereview.chromium.org/11336008/diff/3007/chrome/common/pref_names_util.h#newcode1 chrome/common/pref_names_util.h:1: // Copyright (c) 2010 The Chromium Authors. All rights ...
8 years, 1 month ago (2012-10-30 01:22:19 UTC) #4
Nico
lgtm with comments https://codereview.chromium.org/11336008/diff/3007/chrome/browser/ui/prefs/prefs_tab_helper.cc File chrome/browser/ui/prefs/prefs_tab_helper.cc (right): https://codereview.chromium.org/11336008/diff/3007/chrome/browser/ui/prefs/prefs_tab_helper.cc#newcode356 chrome/browser/ui/prefs/prefs_tab_helper.cc:356: WebPreferences::ScriptFontFamilyMap* map; = NULL Else it ...
8 years, 1 month ago (2012-10-30 04:24:28 UTC) #5
falken
Thanks for the reviews. http://codereview.chromium.org/11336008/diff/3007/chrome/browser/ui/prefs/prefs_tab_helper.cc File chrome/browser/ui/prefs/prefs_tab_helper.cc (right): http://codereview.chromium.org/11336008/diff/3007/chrome/browser/ui/prefs/prefs_tab_helper.cc#newcode356 chrome/browser/ui/prefs/prefs_tab_helper.cc:356: WebPreferences::ScriptFontFamilyMap* map; On 2012/10/30 04:24:29, ...
8 years, 1 month ago (2012-10-30 07:01:34 UTC) #6
tony
https://codereview.chromium.org/11336008/diff/1008/chrome/common/pref_names_util.h File chrome/common/pref_names_util.h (right): https://codereview.chromium.org/11336008/diff/1008/chrome/common/pref_names_util.h#newcode10 chrome/common/pref_names_util.h:10: namespace pref_names_util { Oh yeah, this should be in ...
8 years, 1 month ago (2012-10-30 17:13:15 UTC) #7
Nico
https://codereview.chromium.org/11336008/diff/1008/chrome/common/pref_names_util.h File chrome/common/pref_names_util.h (right): https://codereview.chromium.org/11336008/diff/1008/chrome/common/pref_names_util.h#newcode10 chrome/common/pref_names_util.h:10: namespace pref_names_util { On 2012/10/30 17:13:16, tony wrote: > ...
8 years, 1 month ago (2012-10-30 17:16:11 UTC) #8
Matt Perry
extensions lgtm
8 years, 1 month ago (2012-10-30 20:28:16 UTC) #9
tony
https://codereview.chromium.org/11336008/diff/1008/chrome/common/pref_names_util.h File chrome/common/pref_names_util.h (right): https://codereview.chromium.org/11336008/diff/1008/chrome/common/pref_names_util.h#newcode10 chrome/common/pref_names_util.h:10: namespace pref_names_util { On 2012/10/30 17:16:12, Nico wrote: > ...
8 years, 1 month ago (2012-10-30 20:53:12 UTC) #10
Bernhard Bauer
On 2012/10/30 20:53:12, tony wrote: > https://codereview.chromium.org/11336008/diff/1008/chrome/common/pref_names_util.h > File chrome/common/pref_names_util.h (right): > > https://codereview.chromium.org/11336008/diff/1008/chrome/common/pref_names_util.h#newcode10 > ...
8 years, 1 month ago (2012-10-30 20:57:51 UTC) #11
Nico
On Tue, Oct 30, 2012 at 1:53 PM, <tony@chromium.org> wrote: > > https://codereview.chromium.org/11336008/diff/1008/chrome/common/pref_names_util.h > File ...
8 years, 1 month ago (2012-10-30 20:57:59 UTC) #12
tony
On 2012/10/30 20:57:59, Nico wrote: > Some stuff is feature-based (win_util, about_flags, platform_util, > extensions, ...
8 years, 1 month ago (2012-10-30 21:16:56 UTC) #13
falken
Hi Bernhard, please take another look. As for the namespace, looking at other util and ...
8 years, 1 month ago (2012-10-31 06:27:59 UTC) #14
Bernhard Bauer
lgtm
8 years, 1 month ago (2012-10-31 06:33:01 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/falken@chromium.org/11336008/16008
8 years, 1 month ago (2012-10-31 06:37:05 UTC) #16
commit-bot: I haz the power
8 years, 1 month ago (2012-10-31 08:34:22 UTC) #17
Change committed as 165125

Powered by Google App Engine
This is Rietveld 408576698