OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef FontLoader_h | |
6 #define FontLoader_h | |
7 | |
8 #include "core/fetch/ResourceLoader.h" | |
9 #include "platform/Timer.h" | |
10 #include "platform/heap/Handle.h" | |
11 #include "wtf/Vector.h" | |
12 | |
13 namespace blink { | |
14 | |
15 class CSSFontSelector; | |
16 class Document; | |
17 class FontResource; | |
18 | |
19 class FontLoader : public GarbageCollectedFinalized<FontLoader> { | |
20 USING_PRE_FINALIZER(FontLoader, dispose); | |
21 public: | |
22 static FontLoader* create(CSSFontSelector* fontSelector, Document* document) | |
23 { | |
24 return new FontLoader(fontSelector, document); | |
25 } | |
26 ~FontLoader(); | |
27 void dispose(); | |
28 | |
29 void addFontToBeginLoading(FontResource*); | |
30 void loadPendingFonts(); | |
31 void fontFaceInvalidated(); | |
32 void didFailToDecode(FontResource*); | |
33 | |
34 DECLARE_TRACE(); | |
35 | |
36 private: | |
37 FontLoader(CSSFontSelector*, Document*); | |
38 void beginLoadTimerFired(Timer<FontLoader>*); | |
39 void clearPendingFonts(); | |
40 | |
41 Timer<FontLoader> m_beginLoadingTimer; | |
42 | |
43 struct FontToLoad; | |
44 using FontsToLoadVector = HeapVector<Member<FontToLoad>>; | |
45 FontsToLoadVector m_fontsToBeginLoading; | |
46 Member<CSSFontSelector> m_fontSelector; | |
47 WeakMember<Document> m_document; | |
48 }; | |
49 | |
50 } // namespace blink | |
51 | |
52 #endif // FontLoader_h | |
OLD | NEW |