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

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: Address hiroshige's comments 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 24 matching lines...) Expand all
66 // FontCacheClient implementation 65 // FontCacheClient implementation
67 void fontCacheInvalidated() override; 66 void fontCacheInvalidated() override;
68 67
69 void registerForInvalidationCallbacks(CSSFontSelectorClient*); 68 void registerForInvalidationCallbacks(CSSFontSelectorClient*);
70 #if !ENABLE(OILPAN) 69 #if !ENABLE(OILPAN)
71 void unregisterForInvalidationCallbacks(CSSFontSelectorClient*); 70 void unregisterForInvalidationCallbacks(CSSFontSelectorClient*);
72 #endif 71 #endif
73 72
74 Document* document() const { return m_document; } 73 Document* document() const { return m_document; }
75 FontFaceCache* fontFaceCache() { return &m_fontFaceCache; } 74 FontFaceCache* fontFaceCache() { return &m_fontFaceCache; }
76 FontLoader* fontLoader() { return m_fontLoader.get(); }
77 75
78 const GenericFontFamilySettings& genericFontFamilySettings() const { return m_genericFontFamilySettings; } 76 const GenericFontFamilySettings& genericFontFamilySettings() const { return m_genericFontFamilySettings; }
79 void updateGenericFontFamilySettings(Document&); 77 void updateGenericFontFamilySettings(Document&);
80 78
81 DECLARE_VIRTUAL_TRACE(); 79 DECLARE_VIRTUAL_TRACE();
82 80
83 protected: 81 protected:
84 explicit CSSFontSelector(Document*); 82 explicit CSSFontSelector(Document*);
85 83
86 void dispatchInvalidationCallbacks(); 84 void dispatchInvalidationCallbacks();
87 85
88 private: 86 private:
89 // FIXME: Oilpan: Ideally this should just be a traced Member but that will 87 // FIXME: Oilpan: Ideally this should just be a traced Member but that will
90 // currently leak because ComputedStyle and its data are not on the heap. 88 // currently leak because ComputedStyle and its data are not on the heap.
91 // See crbug.com/383860 for details. 89 // See crbug.com/383860 for details.
92 WeakMember<Document> m_document; 90 WeakMember<Document> m_document;
93 // FIXME: Move to Document or StyleEngine. 91 // FIXME: Move to Document or StyleEngine.
94 FontFaceCache m_fontFaceCache; 92 FontFaceCache m_fontFaceCache;
95 HeapHashSet<WeakMember<CSSFontSelectorClient>> m_clients; 93 HeapHashSet<WeakMember<CSSFontSelectorClient>> m_clients;
96
97 Member<FontLoader> m_fontLoader;
98 GenericFontFamilySettings m_genericFontFamilySettings; 94 GenericFontFamilySettings m_genericFontFamilySettings;
99 }; 95 };
100 96
101 } // namespace blink 97 } // namespace blink
102 98
103 #endif // CSSFontSelector_h 99 #endif // CSSFontSelector_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698