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

Unified Diff: third_party/WebKit/Source/core/css/CSSFontSelector.cpp

Issue 2728513002: Revert of Move the FontFaceCache stored in CSSFontSelector to be stored in Document. (Closed)
Patch Set: Created 3 years, 10 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/core/css/CSSFontSelector.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSFontSelector.cpp b/third_party/WebKit/Source/core/css/CSSFontSelector.cpp
index 13c4993a3573e3aa33f7cd9c1042c4dd1af3e24d..a4d1100995d9579fbf7b852d1bbefb47d2b5c9ad 100644
--- a/third_party/WebKit/Source/core/css/CSSFontSelector.cpp
+++ b/third_party/WebKit/Source/core/css/CSSFontSelector.cpp
@@ -52,7 +52,8 @@
ASSERT(m_document);
DCHECK(m_document->frame());
FontCache::fontCache()->addClient(this);
- FontFaceSet::from(*document)->addFontFacesToFontFaceCache(this);
+ FontFaceSet::from(*document)->addFontFacesToFontFaceCache(&m_fontFaceCache,
+ this);
}
CSSFontSelector::~CSSFontSelector() {}
@@ -68,7 +69,7 @@
}
void CSSFontSelector::dispatchInvalidationCallbacks() {
- m_document->incrementFontFaceVersion();
+ m_fontFaceCache.incrementVersion();
HeapVector<Member<CSSFontSelectorClient>> clients;
copyToVector(m_clients, clients);
@@ -120,15 +121,15 @@
PassRefPtr<FontData> CSSFontSelector::getFontData(
const FontDescription& fontDescription,
- const AtomicString& family) {
- CSSSegmentedFontFace* face = getFontFaceFromCache(fontDescription, family);
- if (face)
+ const AtomicString& familyName) {
+ if (CSSSegmentedFontFace* face =
+ m_fontFaceCache.get(fontDescription, familyName))
return face->getFontData(fontDescription);
// Try to return the correct font based off our settings, in case we were
// handed the generic font family name.
AtomicString settingsFamilyName = familyNameFromSettings(
- m_genericFontFamilySettings, fontDescription, family);
+ m_genericFontFamilySettings, fontDescription, familyName);
if (settingsFamilyName.isEmpty())
return nullptr;
@@ -139,7 +140,7 @@
void CSSFontSelector::willUseFontData(const FontDescription& fontDescription,
const AtomicString& family,
const String& text) {
- CSSSegmentedFontFace* face = getFontFaceFromCache(fontDescription, family);
+ CSSSegmentedFontFace* face = m_fontFaceCache.get(fontDescription, family);
if (face)
face->willUseFontData(fontDescription, text);
}
@@ -147,7 +148,7 @@
void CSSFontSelector::willUseRange(const FontDescription& fontDescription,
const AtomicString& family,
const FontDataForRangeSet& rangeSet) {
- CSSSegmentedFontFace* face = getFontFaceFromCache(fontDescription, family);
+ CSSSegmentedFontFace* face = m_fontFaceCache.get(fontDescription, family);
if (face)
face->willUseRange(fontDescription, rangeSet);
}
@@ -173,6 +174,7 @@
DEFINE_TRACE(CSSFontSelector) {
visitor->trace(m_document);
+ visitor->trace(m_fontFaceCache);
visitor->trace(m_clients);
FontSelector::trace(visitor);
}
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSFontSelector.h ('k') | third_party/WebKit/Source/core/css/FontFaceSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698