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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSFontSelector.h

Issue 1829403002: Clean up font loading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Resource_status
Patch Set: Another rebase! Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 10 matching lines...) Expand all
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef CSSFontSelector_h 26 #ifndef CSSFontSelector_h
27 #define CSSFontSelector_h 27 #define CSSFontSelector_h
28 28
29 #include "core/CoreExport.h" 29 #include "core/CoreExport.h"
30 #include "core/css/FontFaceCache.h" 30 #include "core/css/FontFaceCache.h"
31 #include "core/css/FontLoader.h"
32 #include "platform/fonts/FontSelector.h" 31 #include "platform/fonts/FontSelector.h"
33 #include "platform/fonts/GenericFontFamilySettings.h" 32 #include "platform/fonts/GenericFontFamilySettings.h"
34 #include "platform/heap/Handle.h" 33 #include "platform/heap/Handle.h"
35 #include "wtf/Forward.h" 34 #include "wtf/Forward.h"
36 #include "wtf/HashMap.h" 35 #include "wtf/HashMap.h"
37 #include "wtf/HashSet.h" 36 #include "wtf/HashSet.h"
38 37
39 namespace blink { 38 namespace blink {
40 39
41 class CSSFontSelectorClient; 40 class CSSFontSelectorClient;
(...skipping 17 matching lines...) Expand all
59 58
60 void fontFaceInvalidated(); 59 void fontFaceInvalidated();
61 60
62 // FontCacheClient implementation 61 // FontCacheClient implementation
63 void fontCacheInvalidated() override; 62 void fontCacheInvalidated() override;
64 63
65 void registerForInvalidationCallbacks(CSSFontSelectorClient*); 64 void registerForInvalidationCallbacks(CSSFontSelectorClient*);
66 65
67 Document* document() const { return m_document; } 66 Document* document() const { return m_document; }
68 FontFaceCache* fontFaceCache() { return &m_fontFaceCache; } 67 FontFaceCache* fontFaceCache() { return &m_fontFaceCache; }
69 FontLoader* fontLoader() { return m_fontLoader.get(); }
70 68
71 const GenericFontFamilySettings& genericFontFamilySettings() const { return m_genericFontFamilySettings; } 69 const GenericFontFamilySettings& genericFontFamilySettings() const { return m_genericFontFamilySettings; }
72 void updateGenericFontFamilySettings(Document&); 70 void updateGenericFontFamilySettings(Document&);
73 71
74 DECLARE_VIRTUAL_TRACE(); 72 DECLARE_VIRTUAL_TRACE();
75 73
76 protected: 74 protected:
77 explicit CSSFontSelector(Document*); 75 explicit CSSFontSelector(Document*);
78 76
79 void dispatchInvalidationCallbacks(); 77 void dispatchInvalidationCallbacks();
80 78
81 private: 79 private:
82 // TODO(Oilpan): Ideally this should just be a traced Member but that will 80 // TODO(Oilpan): Ideally this should just be a traced Member but that will
83 // currently leak because ComputedStyle and its data are not on the heap. 81 // currently leak because ComputedStyle and its data are not on the heap.
84 // See crbug.com/383860 for details. 82 // See crbug.com/383860 for details.
85 WeakMember<Document> m_document; 83 WeakMember<Document> m_document;
86 // FIXME: Move to Document or StyleEngine. 84 // FIXME: Move to Document or StyleEngine.
87 FontFaceCache m_fontFaceCache; 85 FontFaceCache m_fontFaceCache;
88 HeapHashSet<WeakMember<CSSFontSelectorClient>> m_clients; 86 HeapHashSet<WeakMember<CSSFontSelectorClient>> m_clients;
89
90 Member<FontLoader> m_fontLoader;
91 GenericFontFamilySettings m_genericFontFamilySettings; 87 GenericFontFamilySettings m_genericFontFamilySettings;
92 }; 88 };
93 89
94 } // namespace blink 90 } // namespace blink
95 91
96 #endif // CSSFontSelector_h 92 #endif // CSSFontSelector_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/css/CSSFontSelector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698