| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are met: | 5 * modification, are permitted provided that the following conditions are met: |
| 6 * | 6 * |
| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 class CSSFontSelector; | 50 class CSSFontSelector; |
| 51 class Dictionary; | 51 class Dictionary; |
| 52 class Document; | 52 class Document; |
| 53 class ExceptionState; | 53 class ExceptionState; |
| 54 class Font; | 54 class Font; |
| 55 class FontFaceCache; | 55 class FontFaceCache; |
| 56 class FontResource; | 56 class FontResource; |
| 57 class FontsReadyPromiseResolver; | 57 class FontsReadyPromiseResolver; |
| 58 class ExecutionContext; | 58 class ExecutionContext; |
| 59 | 59 |
| 60 // FIXME: Oilpan: Make this RefCountedGarbageCollected<FontFaceCache> and HeapSu
pplement<Document> once all document supplements are moved to the managed heap. | 60 #if ENABLE(OILPAN) |
| 61 class FontFaceSet FINAL : public RefCountedSupplementWillBeRefCountedGarbageColl
ectedSupplement<Document, FontFaceSet>, public ActiveDOMObject, public EventTarg
etWithInlineData { | 61 class FontFaceSet FINAL : public RefCountedGarbageCollected<FontFaceSet>, public
HeapSupplement<Document>, public ActiveDOMObject, public EventTargetWithInlineD
ata { |
| 62 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<F
ontFaceSet>); | 62 USING_GARBAGE_COLLECTED_MIXIN(FontFaceSet); |
| 63 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedGarbageCollected<FontFaceSet>); |
| 64 typedef HeapSupplement<Document> SupplementType; |
| 65 #else |
| 66 class FontFaceSet FINAL : public RefCountedSupplement<Document, FontFaceSet>, pu
blic ActiveDOMObject, public EventTargetWithInlineData { |
| 67 DEFINE_EVENT_TARGET_REFCOUNTING(RefCounted<FontFaceSet>); |
| 68 typedef RefCountedSupplement<Document, FontFaceSet> SupplementType; |
| 69 #endif |
| 63 public: | 70 public: |
| 64 virtual ~FontFaceSet(); | 71 virtual ~FontFaceSet(); |
| 65 | 72 |
| 66 DEFINE_ATTRIBUTE_EVENT_LISTENER(loading); | 73 DEFINE_ATTRIBUTE_EVENT_LISTENER(loading); |
| 67 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingdone); | 74 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingdone); |
| 68 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingerror); | 75 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingerror); |
| 69 | 76 |
| 70 bool check(const String& font, const String& text, ExceptionState&); | 77 bool check(const String& font, const String& text, ExceptionState&); |
| 71 ScriptPromise load(const String& font, const String& text); | 78 ScriptPromise load(const String& font, const String& text); |
| 72 ScriptPromise ready(); | 79 ScriptPromise ready(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 99 static PassRefPtrWillBeRawPtr<FontFaceSet> from(Document&); | 106 static PassRefPtrWillBeRawPtr<FontFaceSet> from(Document&); |
| 100 static void didLayout(Document&); | 107 static void didLayout(Document&); |
| 101 | 108 |
| 102 void addFontFacesToFontFaceCache(FontFaceCache*, CSSFontSelector*); | 109 void addFontFacesToFontFaceCache(FontFaceCache*, CSSFontSelector*); |
| 103 | 110 |
| 104 #if ENABLE(OILPAN) | 111 #if ENABLE(OILPAN) |
| 105 virtual void trace(Visitor*) OVERRIDE; | 112 virtual void trace(Visitor*) OVERRIDE; |
| 106 #endif | 113 #endif |
| 107 | 114 |
| 108 private: | 115 private: |
| 109 typedef RefCountedSupplementWillBeRefCountedGarbageCollectedSupplement<Docum
ent, FontFaceSet> SupplementType; | |
| 110 | |
| 111 static PassRefPtrWillBeRawPtr<FontFaceSet> create(Document& document) | 116 static PassRefPtrWillBeRawPtr<FontFaceSet> create(Document& document) |
| 112 { | 117 { |
| 113 return adoptRefWillBeRefCountedGarbageCollected<FontFaceSet>(new FontFac
eSet(document)); | 118 return adoptRefWillBeRefCountedGarbageCollected<FontFaceSet>(new FontFac
eSet(document)); |
| 114 } | 119 } |
| 115 | 120 |
| 116 class FontLoadHistogram { | 121 class FontLoadHistogram { |
| 117 public: | 122 public: |
| 118 enum Status { NoWebFonts, HadBlankText, DidNotHaveBlankText, Reported }; | 123 enum Status { NoWebFonts, HadBlankText, DidNotHaveBlankText, Reported }; |
| 119 FontLoadHistogram() : m_status(NoWebFonts), m_count(0), m_recorded(false
) { } | 124 FontLoadHistogram() : m_status(NoWebFonts), m_count(0), m_recorded(false
) { } |
| 120 void incrementCount() { m_count++; } | 125 void incrementCount() { m_count++; } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 ListHashSet<RefPtrWillBeMember<FontFace> > m_nonCSSConnectedFaces; | 157 ListHashSet<RefPtrWillBeMember<FontFace> > m_nonCSSConnectedFaces; |
| 153 | 158 |
| 154 AsyncMethodRunner<FontFaceSet> m_asyncRunner; | 159 AsyncMethodRunner<FontFaceSet> m_asyncRunner; |
| 155 | 160 |
| 156 FontLoadHistogram m_histogram; | 161 FontLoadHistogram m_histogram; |
| 157 }; | 162 }; |
| 158 | 163 |
| 159 } // namespace WebCore | 164 } // namespace WebCore |
| 160 | 165 |
| 161 #endif // FontFaceSet_h | 166 #endif // FontFaceSet_h |
| OLD | NEW |