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.
8 #include "core/fetch/ResourceLoader.h"
9 #include "core/fetch/ResourcePtr.h"
10 #include "platform/Timer.h"
11 #include "platform/heap/Handle.h"
12 #include "wtf/Vector.h"
16 class CSSFontSelector
;
20 class FontLoader
: public RefCountedWillBeGarbageCollectedFinalized
<FontLoader
> {
22 static PassRefPtrWillBeRawPtr
<FontLoader
> create(CSSFontSelector
* fontSelector
, Document
* document
)
24 return adoptRefWillBeNoop(new FontLoader(fontSelector
, document
));
28 void addFontToBeginLoading(FontResource
*);
29 void loadPendingFonts();
30 void fontFaceInvalidated();
31 void didFailToDecode(FontResource
*);
34 void clearDocumentAndFontSelector();
40 FontLoader(CSSFontSelector
*, Document
*);
41 void beginLoadTimerFired(Timer
<FontLoader
>*);
42 void clearPendingFonts();
44 Timer
<FontLoader
> m_beginLoadingTimer
;
47 using FontsToLoadVector
= Vector
<OwnPtr
<FontToLoad
>>;
48 FontsToLoadVector m_fontsToBeginLoading
;
49 RawPtrWillBeMember
<CSSFontSelector
> m_fontSelector
;
50 RawPtrWillBeWeakMember
<Document
> m_document
;
55 #endif // FontLoader_h