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

Unified Diff: third_party/WebKit/Source/platform/fonts/AlternateFontFamily.h

Issue 1844223002: Literal AtomicString construction can rely on strlen optimization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/fonts/AlternateFontFamily.h
diff --git a/third_party/WebKit/Source/platform/fonts/AlternateFontFamily.h b/third_party/WebKit/Source/platform/fonts/AlternateFontFamily.h
index 6a1eb991e0b77ba7b2f44a7713535b4afad08556..45a4b4d3192f6bb92f89425072f62704032a8a2e 100644
--- a/third_party/WebKit/Source/platform/fonts/AlternateFontFamily.h
+++ b/third_party/WebKit/Source/platform/fonts/AlternateFontFamily.h
@@ -46,24 +46,24 @@ inline const AtomicString& adjustFamilyNameToAvoidUnsupportedFonts(const AtomicS
// 'Courier' is a bitmap font. On Mac on the other hand 'Courier' is
// a truetype font. Thus pages asking for Courier are better of
// using 'Courier New' on windows.
- DEFINE_STATIC_LOCAL(AtomicString, courier, ("Courier", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(AtomicString, courierNew, ("Courier New", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, courier, ("Courier"));
+ DEFINE_STATIC_LOCAL(AtomicString, courierNew, ("Courier New"));
if (equalIgnoringCase(familyName, courier))
return courierNew;
// Alias 'MS Sans Serif' (bitmap font) -> 'Microsoft Sans Serif'
// (truetype font).
- DEFINE_STATIC_LOCAL(AtomicString, msSans, ("MS Sans Serif", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(AtomicString, microsoftSans, ("Microsoft Sans Serif", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, msSans, ("MS Sans Serif"));
+ DEFINE_STATIC_LOCAL(AtomicString, microsoftSans, ("Microsoft Sans Serif"));
if (equalIgnoringCase(familyName, msSans))
return microsoftSans;
// Alias 'MS Serif' (bitmap) -> 'Times New Roman' (truetype font).
// Alias 'Times' -> 'Times New Roman' (truetype font).
// There's no 'Microsoft Sans Serif-equivalent' for Serif.
- DEFINE_STATIC_LOCAL(AtomicString, msSerif, ("MS Serif", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(AtomicString, times, ("Times", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(AtomicString, timesNewRoman, ("Times New Roman", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, msSerif, ("MS Serif"));
+ DEFINE_STATIC_LOCAL(AtomicString, times, ("Times"));
+ DEFINE_STATIC_LOCAL(AtomicString, timesNewRoman, ("Times New Roman"));
if (equalIgnoringCase(familyName, msSerif) || equalIgnoringCase(familyName, times))
return timesNewRoman;
#endif
@@ -74,8 +74,8 @@ inline const AtomicString& adjustFamilyNameToAvoidUnsupportedFonts(const AtomicS
inline const AtomicString& alternateFamilyName(const AtomicString& familyName)
{
// Alias Courier <-> Courier New
- DEFINE_STATIC_LOCAL(AtomicString, courier, ("Courier", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(AtomicString, courierNew, ("Courier New", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, courier, ("Courier"));
+ DEFINE_STATIC_LOCAL(AtomicString, courierNew, ("Courier New"));
if (equalIgnoringCase(familyName, courier))
return courierNew;
#if !OS(WIN)
@@ -87,16 +87,16 @@ inline const AtomicString& alternateFamilyName(const AtomicString& familyName)
#endif
// Alias Times and Times New Roman.
- DEFINE_STATIC_LOCAL(AtomicString, times, ("Times", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(AtomicString, timesNewRoman, ("Times New Roman", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, times, ("Times"));
+ DEFINE_STATIC_LOCAL(AtomicString, timesNewRoman, ("Times New Roman"));
if (equalIgnoringCase(familyName, times))
return timesNewRoman;
if (equalIgnoringCase(familyName, timesNewRoman))
return times;
// Alias Arial and Helvetica
- DEFINE_STATIC_LOCAL(AtomicString, arial, ("Arial", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(AtomicString, helvetica, ("Helvetica", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, arial, ("Arial"));
+ DEFINE_STATIC_LOCAL(AtomicString, helvetica, ("Helvetica"));
if (equalIgnoringCase(familyName, arial))
return helvetica;
if (equalIgnoringCase(familyName, helvetica))
@@ -108,11 +108,11 @@ inline const AtomicString& alternateFamilyName(const AtomicString& familyName)
inline const AtomicString getFallbackFontFamily(const FontDescription& description)
{
- DEFINE_STATIC_LOCAL(const AtomicString, sansStr, ("sans-serif", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(const AtomicString, serifStr, ("serif", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(const AtomicString, monospaceStr, ("monospace", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(const AtomicString, cursiveStr, ("cursive", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(const AtomicString, fantasyStr, ("fantasy", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(const AtomicString, sansStr, ("sans-serif"));
+ DEFINE_STATIC_LOCAL(const AtomicString, serifStr, ("serif"));
+ DEFINE_STATIC_LOCAL(const AtomicString, monospaceStr, ("monospace"));
+ DEFINE_STATIC_LOCAL(const AtomicString, cursiveStr, ("cursive"));
+ DEFINE_STATIC_LOCAL(const AtomicString, fantasyStr, ("fantasy"));
switch (description.genericFamily()) {
case FontDescription::SansSerifFamily:

Powered by Google App Engine
This is Rietveld 408576698