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 public: | |
21 static FontLoader* create(CSSFontSelector* fontSelector, Document* document) | |
22 { | |
23 return new FontLoader(fontSelector, document); | |
24 } | |
25 ~FontLoader(); | |
26 | |
27 void addFontToBeginLoading(FontResource*); | |
28 void loadPendingFonts(); | |
29 void fontFaceInvalidated(); | |
30 void didFailToDecode(FontResource*); | |
31 | |
32 #if !ENABLE(OILPAN) | |
33 void clearDocumentAndFontSelector(); | |
34 #endif | |
35 | |
36 DECLARE_TRACE(); | |
37 | |
38 private: | |
39 FontLoader(CSSFontSelector*, Document*); | |
40 void beginLoadTimerFired(Timer<FontLoader>*); | |
41 void clearPendingFonts(); | |
42 | |
43 Timer<FontLoader> m_beginLoadingTimer; | |
44 | |
45 struct FontToLoad; | |
46 using FontsToLoadVector = HeapVector<Member<FontToLoad>>; | |
47 FontsToLoadVector m_fontsToBeginLoading; | |
48 Member<CSSFontSelector> m_fontSelector; | |
49 WeakMember<Document> m_document; | |
50 }; | |
51 | |
52 } // namespace blink | |
53 | |
54 #endif // FontLoader_h | |
OLD | NEW |