| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef CSSFontSelector_h | 26 #ifndef CSSFontSelector_h |
| 27 #define CSSFontSelector_h | 27 #define CSSFontSelector_h |
| 28 | 28 |
| 29 #include "core/css/FontFaceCache.h" | 29 #include "core/css/FontFaceCache.h" |
| 30 #include "core/fetch/ResourcePtr.h" | 30 #include "core/fetch/ResourcePtr.h" |
| 31 #include "heap/Handle.h" |
| 31 #include "platform/Timer.h" | 32 #include "platform/Timer.h" |
| 32 #include "platform/fonts/FontSelector.h" | 33 #include "platform/fonts/FontSelector.h" |
| 33 #include "platform/fonts/GenericFontFamilySettings.h" | 34 #include "platform/fonts/GenericFontFamilySettings.h" |
| 34 #include "wtf/Forward.h" | 35 #include "wtf/Forward.h" |
| 35 #include "wtf/HashMap.h" | 36 #include "wtf/HashMap.h" |
| 36 #include "wtf/HashSet.h" | 37 #include "wtf/HashSet.h" |
| 37 | 38 |
| 38 namespace WebCore { | 39 namespace WebCore { |
| 39 | 40 |
| 40 class CSSFontFace; | 41 class CSSFontFace; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 virtual void willUseFontData(const FontDescription&, const AtomicString& fam
ily) OVERRIDE; | 78 virtual void willUseFontData(const FontDescription&, const AtomicString& fam
ily) OVERRIDE; |
| 78 | 79 |
| 79 void clearDocument(); | 80 void clearDocument(); |
| 80 | 81 |
| 81 void fontLoaded(); | 82 void fontLoaded(); |
| 82 | 83 |
| 83 // FontCacheClient implementation | 84 // FontCacheClient implementation |
| 84 virtual void fontCacheInvalidated() OVERRIDE; | 85 virtual void fontCacheInvalidated() OVERRIDE; |
| 85 | 86 |
| 86 void registerForInvalidationCallbacks(CSSFontSelectorClient*); | 87 void registerForInvalidationCallbacks(CSSFontSelectorClient*); |
| 88 #if !ENABLE(OILPAN) |
| 87 void unregisterForInvalidationCallbacks(CSSFontSelectorClient*); | 89 void unregisterForInvalidationCallbacks(CSSFontSelectorClient*); |
| 90 #endif |
| 88 | 91 |
| 89 Document* document() const { return m_document; } | 92 Document* document() const { return m_document; } |
| 90 FontFaceCache* fontFaceCache() { return &m_fontFaceCache; } | 93 FontFaceCache* fontFaceCache() { return &m_fontFaceCache; } |
| 91 | 94 |
| 92 const GenericFontFamilySettings& genericFontFamilySettings() const { return
m_genericFontFamilySettings; } | 95 const GenericFontFamilySettings& genericFontFamilySettings() const { return
m_genericFontFamilySettings; } |
| 93 void updateGenericFontFamilySettings(Document&); | 96 void updateGenericFontFamilySettings(Document&); |
| 94 | 97 |
| 95 void beginLoadingFontSoon(FontResource*); | 98 void beginLoadingFontSoon(FontResource*); |
| 96 void loadPendingFonts(); | 99 void loadPendingFonts(); |
| 97 | 100 |
| 98 private: | 101 private: |
| 99 explicit CSSFontSelector(Document*); | 102 explicit CSSFontSelector(Document*); |
| 100 | 103 |
| 101 void dispatchInvalidationCallbacks(); | 104 void dispatchInvalidationCallbacks(); |
| 102 | 105 |
| 103 Document* m_document; | 106 Document* m_document; |
| 104 // FIXME: Move to Document or StyleEngine. | 107 // FIXME: Move to Document or StyleEngine. |
| 105 FontFaceCache m_fontFaceCache; | 108 FontFaceCache m_fontFaceCache; |
| 106 HashSet<CSSFontSelectorClient*> m_clients; | 109 WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<CSSFontSelectorClient> >
m_clients; |
| 107 | 110 |
| 108 FontLoader m_fontLoader; | 111 FontLoader m_fontLoader; |
| 109 GenericFontFamilySettings m_genericFontFamilySettings; | 112 GenericFontFamilySettings m_genericFontFamilySettings; |
| 110 }; | 113 }; |
| 111 | 114 |
| 112 } // namespace WebCore | 115 } // namespace WebCore |
| 113 | 116 |
| 114 #endif // CSSFontSelector_h | 117 #endif // CSSFontSelector_h |
| OLD | NEW |