| 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 25 matching lines...) Expand all Loading... |
| 36 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
| 37 #include "wtf/PassRefPtr.h" | 37 #include "wtf/PassRefPtr.h" |
| 38 #include "wtf/Vector.h" | 38 #include "wtf/Vector.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 class FontDescription; | 42 class FontDescription; |
| 43 class RemoteFontFaceSource; | 43 class RemoteFontFaceSource; |
| 44 class SimpleFontData; | 44 class SimpleFontData; |
| 45 | 45 |
| 46 class CORE_EXPORT CSSFontFace final : public NoBaseWillBeGarbageCollectedFinaliz
ed<CSSFontFace> { | 46 class CORE_EXPORT CSSFontFace final : public GarbageCollectedFinalized<CSSFontFa
ce> { |
| 47 USING_FAST_MALLOC_WILL_BE_REMOVED(CSSFontFace); | |
| 48 WTF_MAKE_NONCOPYABLE(CSSFontFace); | 47 WTF_MAKE_NONCOPYABLE(CSSFontFace); |
| 49 public: | 48 public: |
| 50 CSSFontFace(FontFace* fontFace, Vector<UnicodeRange>& ranges) | 49 CSSFontFace(FontFace* fontFace, Vector<UnicodeRange>& ranges) |
| 51 : m_ranges(adoptRef(new UnicodeRangeSet(ranges))) | 50 : m_ranges(adoptRef(new UnicodeRangeSet(ranges))) |
| 52 , m_segmentedFontFace(nullptr) | 51 , m_segmentedFontFace(nullptr) |
| 53 , m_fontFace(fontFace) | 52 , m_fontFace(fontFace) |
| 54 { | 53 { |
| 55 ASSERT(m_fontFace); | 54 ASSERT(m_fontFace); |
| 56 } | 55 } |
| 57 | 56 |
| 58 FontFace* fontFace() const { return m_fontFace; } | 57 FontFace* fontFace() const { return m_fontFace; } |
| 59 | 58 |
| 60 PassRefPtr<UnicodeRangeSet> ranges() { return m_ranges; } | 59 PassRefPtr<UnicodeRangeSet> ranges() { return m_ranges; } |
| 61 | 60 |
| 62 void setSegmentedFontFace(CSSSegmentedFontFace*); | 61 void setSegmentedFontFace(CSSSegmentedFontFace*); |
| 63 void clearSegmentedFontFace() { m_segmentedFontFace = nullptr; } | 62 void clearSegmentedFontFace() { m_segmentedFontFace = nullptr; } |
| 64 | 63 |
| 65 bool isValid() const { return !m_sources.isEmpty(); } | 64 bool isValid() const { return !m_sources.isEmpty(); } |
| 66 | 65 |
| 67 void addSource(PassOwnPtrWillBeRawPtr<CSSFontFaceSource>); | 66 void addSource(RawPtr<CSSFontFaceSource>); |
| 68 | 67 |
| 69 void didBeginLoad(); | 68 void didBeginLoad(); |
| 70 void fontLoaded(RemoteFontFaceSource*); | 69 void fontLoaded(RemoteFontFaceSource*); |
| 71 void didBecomeVisibleFallback(RemoteFontFaceSource*); | 70 void didBecomeVisibleFallback(RemoteFontFaceSource*); |
| 72 | 71 |
| 73 PassRefPtr<SimpleFontData> getFontData(const FontDescription&); | 72 PassRefPtr<SimpleFontData> getFontData(const FontDescription&); |
| 74 | 73 |
| 75 FontFace::LoadStatusType loadStatus() const { return m_fontFace->loadStatus(
); } | 74 FontFace::LoadStatusType loadStatus() const { return m_fontFace->loadStatus(
); } |
| 76 bool maybeScheduleFontLoad(const FontDescription&, UChar32); | 75 bool maybeScheduleFontLoad(const FontDescription&, UChar32); |
| 77 bool maybeScheduleFontLoad(const FontDescription&, const FontDataForRangeSet
&); | 76 bool maybeScheduleFontLoad(const FontDescription&, const FontDataForRangeSet
&); |
| 78 void load(); | 77 void load(); |
| 79 void load(const FontDescription&); | 78 void load(const FontDescription&); |
| 80 | 79 |
| 81 bool hadBlankText() { return isValid() && m_sources.first()->hadBlankText();
} | 80 bool hadBlankText() { return isValid() && m_sources.first()->hadBlankText();
} |
| 82 | 81 |
| 83 DECLARE_TRACE(); | 82 DECLARE_TRACE(); |
| 84 | 83 |
| 85 private: | 84 private: |
| 86 void setLoadStatus(FontFace::LoadStatusType); | 85 void setLoadStatus(FontFace::LoadStatusType); |
| 87 | 86 |
| 88 RefPtr<UnicodeRangeSet> m_ranges; | 87 RefPtr<UnicodeRangeSet> m_ranges; |
| 89 RawPtrWillBeMember<CSSSegmentedFontFace> m_segmentedFontFace; | 88 Member<CSSSegmentedFontFace> m_segmentedFontFace; |
| 90 WillBeHeapDeque<OwnPtrWillBeMember<CSSFontFaceSource>> m_sources; | 89 HeapDeque<Member<CSSFontFaceSource>> m_sources; |
| 91 RawPtrWillBeMember<FontFace> m_fontFace; | 90 Member<FontFace> m_fontFace; |
| 92 }; | 91 }; |
| 93 | 92 |
| 94 } // namespace blink | 93 } // namespace blink |
| 95 | 94 |
| 96 #endif | 95 #endif |
| OLD | NEW |