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