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 "core/fetch/ResourcePtr.h" | 9 #include "core/fetch/ResourcePtr.h" |
10 #include "platform/Timer.h" | 10 #include "platform/Timer.h" |
11 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
12 #include "wtf/Vector.h" | 12 #include "wtf/Vector.h" |
13 | 13 |
14 namespace WebCore { | 14 namespace WebCore { |
15 | 15 |
| 16 class CSSFontSelector; |
16 class FontResource; | 17 class FontResource; |
17 | 18 |
18 class FontLoader : public RefCountedWillBeGarbageCollectedFinalized<FontLoader>
{ | 19 class FontLoader : public RefCountedWillBeGarbageCollectedFinalized<FontLoader>
{ |
19 public: | 20 public: |
20 static PassRefPtrWillBeRawPtr<FontLoader> create(ResourceFetcher* fetcher) | 21 static PassRefPtrWillBeRawPtr<FontLoader> create(CSSFontSelector* fontSelect
or, ResourceFetcher* fetcher) |
21 { | 22 { |
22 return adoptRefWillBeNoop(new FontLoader(fetcher)); | 23 return adoptRefWillBeNoop(new FontLoader(fontSelector, fetcher)); |
23 } | 24 } |
24 ~FontLoader(); | 25 ~FontLoader(); |
25 | 26 |
26 void addFontToBeginLoading(FontResource*); | 27 void addFontToBeginLoading(FontResource*); |
27 void loadPendingFonts(); | 28 void loadPendingFonts(); |
| 29 void fontFaceInvalidated(); |
28 | 30 |
29 #if !ENABLE(OILPAN) | 31 #if !ENABLE(OILPAN) |
30 void clearResourceFetcher(); | 32 void clearResourceFetcherAndFontSelector(); |
31 #endif | 33 #endif |
32 | 34 |
33 void trace(Visitor*); | 35 void trace(Visitor*); |
34 | 36 |
35 private: | 37 private: |
36 explicit FontLoader(ResourceFetcher*); | 38 FontLoader(CSSFontSelector*, ResourceFetcher*); |
37 void beginLoadTimerFired(Timer<FontLoader>*); | 39 void beginLoadTimerFired(Timer<FontLoader>*); |
38 | 40 |
39 Timer<FontLoader> m_beginLoadingTimer; | 41 Timer<FontLoader> m_beginLoadingTimer; |
40 | 42 |
41 typedef Vector<std::pair<ResourcePtr<FontResource>, ResourceLoader::RequestC
ountTracker> > FontsToLoadVector; | 43 typedef Vector<std::pair<ResourcePtr<FontResource>, ResourceLoader::RequestC
ountTracker> > FontsToLoadVector; |
42 FontsToLoadVector m_fontsToBeginLoading; | 44 FontsToLoadVector m_fontsToBeginLoading; |
| 45 RawPtrWillBeMember<CSSFontSelector> m_fontSelector; |
43 RawPtrWillBeMember<ResourceFetcher> m_resourceFetcher; | 46 RawPtrWillBeMember<ResourceFetcher> m_resourceFetcher; |
44 }; | 47 }; |
45 | 48 |
46 } // namespace WebCore | 49 } // namespace WebCore |
47 | 50 |
48 #endif // FontLoader_h | 51 #endif // FontLoader_h |
OLD | NEW |