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

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

Issue 2624893003: Move the FontFaceCache stored in CSSFontSelector to be stored in Document. (Closed)
Patch Set: Rebase 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSFontSelector.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/CSSFontSelector.h
diff --git a/third_party/WebKit/Source/core/css/CSSFontSelector.h b/third_party/WebKit/Source/core/css/CSSFontSelector.h
index c1a1b8ae9b9fc9bfdc18c30e3498d36d5ab1e735..6a590fd8c4dbabf73390980ffbf56dd2b54daac6 100644
--- a/third_party/WebKit/Source/core/css/CSSFontSelector.h
+++ b/third_party/WebKit/Source/core/css/CSSFontSelector.h
@@ -28,6 +28,7 @@
#include "core/CoreExport.h"
#include "core/css/FontFaceCache.h"
+#include "core/dom/Document.h"
#include "platform/fonts/FontSelector.h"
#include "platform/fonts/GenericFontFamilySettings.h"
#include "platform/heap/Handle.h"
@@ -38,7 +39,6 @@
namespace blink {
class CSSFontSelectorClient;
-class Document;
class FontDescription;
class CORE_EXPORT CSSFontSelector : public FontSelector {
@@ -48,7 +48,9 @@ class CORE_EXPORT CSSFontSelector : public FontSelector {
}
~CSSFontSelector() override;
- unsigned version() const override { return m_fontFaceCache.version(); }
+ unsigned version() const override {
+ return m_document->fontFaceCache()->version();
+ }
PassRefPtr<FontData> getFontData(const FontDescription&,
const AtomicString&) override;
@@ -70,7 +72,6 @@ class CORE_EXPORT CSSFontSelector : public FontSelector {
void unregisterForInvalidationCallbacks(CSSFontSelectorClient*);
Document* document() const { return m_document; }
- FontFaceCache* fontFaceCache() { return &m_fontFaceCache; }
const GenericFontFamilySettings& genericFontFamilySettings() const {
return m_genericFontFamilySettings;
@@ -85,12 +86,16 @@ class CORE_EXPORT CSSFontSelector : public FontSelector {
void dispatchInvalidationCallbacks();
private:
+ CSSSegmentedFontFace* getFontFaceFromCache(
+ const FontDescription& fontDescription,
+ const AtomicString& family) {
+ return m_document->fontFaceCache()->get(fontDescription, family);
+ }
+
// TODO(Oilpan): Ideally this should just be a traced Member but that will
// currently leak because ComputedStyle and its data are not on the heap.
// See crbug.com/383860 for details.
WeakMember<Document> m_document;
- // FIXME: Move to Document or StyleEngine.
- FontFaceCache m_fontFaceCache;
HeapHashSet<WeakMember<CSSFontSelectorClient>> m_clients;
GenericFontFamilySettings m_genericFontFamilySettings;
};
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSFontSelector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698