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

Unified Diff: third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp

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/SimpleFontData.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp b/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
index 1e18e2b2516e9e7b9c7c22ffd9c237d27f20f7da..f7d013cac6da133afc2f96b7e1e61ab10ba2ae34 100644
--- a/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
+++ b/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
@@ -156,9 +156,9 @@ void SimpleFontData::platformInit()
// web standard. The AppKit adjustment of 20% is too big and is
// incorrectly added to line spacing, so we use a 15% adjustment instead
// and add it to the ascent.
- DEFINE_STATIC_LOCAL(AtomicString, timesName, ("Times", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(AtomicString, helveticaName, ("Helvetica", AtomicString::ConstructFromLiteral));
- DEFINE_STATIC_LOCAL(AtomicString, courierName, ("Courier", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(AtomicString, timesName, ("Times"));
+ DEFINE_STATIC_LOCAL(AtomicString, helveticaName, ("Helvetica"));
+ DEFINE_STATIC_LOCAL(AtomicString, courierName, ("Courier"));
String familyName = m_platformData.fontFamilyName();
if (familyName == timesName || familyName == helveticaName || familyName == courierName)
ascent += floorf(((ascent + descent) * 0.15f) + 0.5f);

Powered by Google App Engine
This is Rietveld 408576698