| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 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 24 matching lines...) Expand all Loading... |
| 35 #include "wtf/Forward.h" | 35 #include "wtf/Forward.h" |
| 36 #include "wtf/PassRefPtr.h" | 36 #include "wtf/PassRefPtr.h" |
| 37 #include "wtf/Vector.h" | 37 #include "wtf/Vector.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 class FontDescription; | 41 class FontDescription; |
| 42 class RemoteFontFaceSource; | 42 class RemoteFontFaceSource; |
| 43 class SimpleFontData; | 43 class SimpleFontData; |
| 44 | 44 |
| 45 class CORE_EXPORT CSSFontFace final : public NoBaseWillBeGarbageCollectedFinaliz
ed<CSSFontFace> { | 45 class CORE_EXPORT CSSFontFace final : public GarbageCollectedFinalized<CSSFontFa
ce> { |
| 46 USING_FAST_MALLOC_WILL_BE_REMOVED(CSSFontFace); | |
| 47 WTF_MAKE_NONCOPYABLE(CSSFontFace); | 46 WTF_MAKE_NONCOPYABLE(CSSFontFace); |
| 48 public: | 47 public: |
| 49 struct UnicodeRange; | 48 struct UnicodeRange; |
| 50 class UnicodeRangeSet; | 49 class UnicodeRangeSet; |
| 51 | 50 |
| 52 CSSFontFace(FontFace* fontFace, Vector<UnicodeRange>& ranges) | 51 CSSFontFace(FontFace* fontFace, Vector<UnicodeRange>& ranges) |
| 53 : m_ranges(ranges) | 52 : m_ranges(ranges) |
| 54 , m_segmentedFontFace(nullptr) | 53 , m_segmentedFontFace(nullptr) |
| 55 , m_fontFace(fontFace) | 54 , m_fontFace(fontFace) |
| 56 { | 55 { |
| 57 ASSERT(m_fontFace); | 56 ASSERT(m_fontFace); |
| 58 } | 57 } |
| 59 | 58 |
| 60 FontFace* fontFace() const { return m_fontFace; } | 59 FontFace* fontFace() const { return m_fontFace; } |
| 61 | 60 |
| 62 UnicodeRangeSet& ranges() { return m_ranges; } | 61 UnicodeRangeSet& ranges() { return m_ranges; } |
| 63 | 62 |
| 64 void setSegmentedFontFace(CSSSegmentedFontFace*); | 63 void setSegmentedFontFace(CSSSegmentedFontFace*); |
| 65 void clearSegmentedFontFace() { m_segmentedFontFace = nullptr; } | 64 void clearSegmentedFontFace() { m_segmentedFontFace = nullptr; } |
| 66 | 65 |
| 67 bool isValid() const { return !m_sources.isEmpty(); } | 66 bool isValid() const { return !m_sources.isEmpty(); } |
| 68 | 67 |
| 69 void addSource(PassOwnPtrWillBeRawPtr<CSSFontFaceSource>); | 68 void addSource(RawPtr<CSSFontFaceSource>); |
| 70 | 69 |
| 71 void didBeginLoad(); | 70 void didBeginLoad(); |
| 72 void fontLoaded(RemoteFontFaceSource*); | 71 void fontLoaded(RemoteFontFaceSource*); |
| 73 void didBecomeVisibleFallback(RemoteFontFaceSource*); | 72 void didBecomeVisibleFallback(RemoteFontFaceSource*); |
| 74 | 73 |
| 75 PassRefPtr<SimpleFontData> getFontData(const FontDescription&); | 74 PassRefPtr<SimpleFontData> getFontData(const FontDescription&); |
| 76 | 75 |
| 77 struct UnicodeRange { | 76 struct UnicodeRange { |
| 78 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 77 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 79 UnicodeRange(UChar32 from, UChar32 to) | 78 UnicodeRange(UChar32 from, UChar32 to) |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 void load(const FontDescription&); | 114 void load(const FontDescription&); |
| 116 | 115 |
| 117 bool hadBlankText() { return isValid() && m_sources.first()->hadBlankText();
} | 116 bool hadBlankText() { return isValid() && m_sources.first()->hadBlankText();
} |
| 118 | 117 |
| 119 DECLARE_TRACE(); | 118 DECLARE_TRACE(); |
| 120 | 119 |
| 121 private: | 120 private: |
| 122 void setLoadStatus(FontFace::LoadStatus); | 121 void setLoadStatus(FontFace::LoadStatus); |
| 123 | 122 |
| 124 UnicodeRangeSet m_ranges; | 123 UnicodeRangeSet m_ranges; |
| 125 RawPtrWillBeMember<CSSSegmentedFontFace> m_segmentedFontFace; | 124 Member<CSSSegmentedFontFace> m_segmentedFontFace; |
| 126 WillBeHeapDeque<OwnPtrWillBeMember<CSSFontFaceSource>> m_sources; | 125 HeapDeque<Member<CSSFontFaceSource>> m_sources; |
| 127 RawPtrWillBeMember<FontFace> m_fontFace; | 126 Member<FontFace> m_fontFace; |
| 128 }; | 127 }; |
| 129 | 128 |
| 130 } // namespace blink | 129 } // namespace blink |
| 131 | 130 |
| 132 #endif | 131 #endif |
| OLD | NEW |