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

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

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
« 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 6a590fd8c4dbabf73390980ffbf56dd2b54daac6..c1a1b8ae9b9fc9bfdc18c30e3498d36d5ab1e735 100644
--- a/third_party/WebKit/Source/core/css/CSSFontSelector.h
+++ b/third_party/WebKit/Source/core/css/CSSFontSelector.h
@@ -28,7 +28,6 @@
#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"
@@ -39,6 +38,7 @@
namespace blink {
class CSSFontSelectorClient;
+class Document;
class FontDescription;
class CORE_EXPORT CSSFontSelector : public FontSelector {
@@ -48,9 +48,7 @@
}
~CSSFontSelector() override;
- unsigned version() const override {
- return m_document->fontFaceCache()->version();
- }
+ unsigned version() const override { return m_fontFaceCache.version(); }
PassRefPtr<FontData> getFontData(const FontDescription&,
const AtomicString&) override;
@@ -72,6 +70,7 @@
void unregisterForInvalidationCallbacks(CSSFontSelectorClient*);
Document* document() const { return m_document; }
+ FontFaceCache* fontFaceCache() { return &m_fontFaceCache; }
const GenericFontFamilySettings& genericFontFamilySettings() const {
return m_genericFontFamilySettings;
@@ -86,16 +85,12 @@
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