| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 void setSegmentedFontFace(CSSSegmentedFontFace*); | 62 void setSegmentedFontFace(CSSSegmentedFontFace*); |
| 63 void clearSegmentedFontFace() { m_segmentedFontFace = nullptr; } | 63 void clearSegmentedFontFace() { m_segmentedFontFace = nullptr; } |
| 64 | 64 |
| 65 bool isValid() const { return !m_sources.isEmpty(); } | 65 bool isValid() const { return !m_sources.isEmpty(); } |
| 66 size_t approximateBlankCharacterCount() const; | 66 size_t approximateBlankCharacterCount() const; |
| 67 | 67 |
| 68 void addSource(CSSFontFaceSource*); | 68 void addSource(CSSFontFaceSource*); |
| 69 | 69 |
| 70 void didBeginLoad(); | 70 void didBeginLoad(); |
| 71 void fontLoaded(RemoteFontFaceSource*); | 71 // Document is required in case the status was an error. |
| 72 void fontLoaded(RemoteFontFaceSource*, Document*); |
| 72 void didBecomeVisibleFallback(RemoteFontFaceSource*); | 73 void didBecomeVisibleFallback(RemoteFontFaceSource*); |
| 73 | 74 |
| 74 PassRefPtr<SimpleFontData> getFontData(const FontDescription&); | 75 PassRefPtr<SimpleFontData> getFontData(const FontDescription&); |
| 75 | 76 |
| 76 FontFace::LoadStatusType loadStatus() const { | 77 FontFace::LoadStatusType loadStatus() const { |
| 77 return m_fontFace->loadStatus(); | 78 return m_fontFace->loadStatus(); |
| 78 } | 79 } |
| 79 bool maybeLoadFont(const FontDescription&, const String&); | 80 bool maybeLoadFont(Document*, const FontDescription&, const String&); |
| 80 bool maybeLoadFont(const FontDescription&, const FontDataForRangeSet&); | 81 bool maybeLoadFont(Document*, |
| 81 void load(); | 82 const FontDescription&, |
| 82 void load(const FontDescription&); | 83 const FontDataForRangeSet&); |
| 84 void load(Document*); |
| 85 void load(Document*, const FontDescription&); |
| 83 | 86 |
| 84 bool hadBlankText() { return isValid() && m_sources.first()->hadBlankText(); } | 87 bool hadBlankText() { return isValid() && m_sources.first()->hadBlankText(); } |
| 85 | 88 |
| 86 DECLARE_TRACE(); | 89 DECLARE_TRACE(); |
| 87 | 90 |
| 88 private: | 91 private: |
| 89 void setLoadStatus(FontFace::LoadStatusType); | 92 void setLoadStatus(FontFace::LoadStatusType); |
| 90 | 93 |
| 91 RefPtr<UnicodeRangeSet> m_ranges; | 94 RefPtr<UnicodeRangeSet> m_ranges; |
| 92 Member<CSSSegmentedFontFace> m_segmentedFontFace; | 95 Member<CSSSegmentedFontFace> m_segmentedFontFace; |
| 93 HeapDeque<Member<CSSFontFaceSource>> m_sources; | 96 HeapDeque<Member<CSSFontFaceSource>> m_sources; |
| 94 Member<FontFace> m_fontFace; | 97 Member<FontFace> m_fontFace; |
| 95 }; | 98 }; |
| 96 | 99 |
| 97 } // namespace blink | 100 } // namespace blink |
| 98 | 101 |
| 99 #endif | 102 #endif |
| OLD | NEW |