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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingdone); | 74 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingdone); |
75 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingerror); | 75 DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingerror); |
76 | 76 |
77 bool check(const String& font, const String& text, ExceptionState&); | 77 bool check(const String& font, const String& text, ExceptionState&); |
78 ScriptPromise load(ScriptState*, const String& font, const String& text); | 78 ScriptPromise load(ScriptState*, const String& font, const String& text); |
79 ScriptPromise ready(ScriptState*); | 79 ScriptPromise ready(ScriptState*); |
80 | 80 |
81 void add(FontFace*, ExceptionState&); | 81 void add(FontFace*, ExceptionState&); |
82 void clear(); | 82 void clear(); |
83 bool remove(FontFace*, ExceptionState&); | 83 bool remove(FontFace*, ExceptionState&); |
84 void forEach(PassOwnPtrWillBeRawPtr<FontFaceSetForEachCallback>, const Scrip
tValue& thisArg) const; | 84 void forEach(FontFaceSetForEachCallback*, const ScriptValue& thisArg) const; |
85 void forEach(PassOwnPtrWillBeRawPtr<FontFaceSetForEachCallback>) const; | 85 void forEach(FontFaceSetForEachCallback*) const; |
86 bool has(FontFace*, ExceptionState&) const; | 86 bool has(FontFace*, ExceptionState&) const; |
87 | 87 |
88 unsigned long size() const; | 88 unsigned long size() const; |
89 AtomicString status() const; | 89 AtomicString status() const; |
90 | 90 |
91 virtual ExecutionContext* executionContext() const OVERRIDE; | 91 virtual ExecutionContext* executionContext() const OVERRIDE; |
92 virtual const AtomicString& interfaceName() const OVERRIDE; | 92 virtual const AtomicString& interfaceName() const OVERRIDE; |
93 | 93 |
94 Document* document() const; | 94 Document* document() const; |
95 | 95 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 Status m_status; | 130 Status m_status; |
131 int m_count; | 131 int m_count; |
132 bool m_recorded; | 132 bool m_recorded; |
133 }; | 133 }; |
134 | 134 |
135 FontFaceSet(Document&); | 135 FontFaceSet(Document&); |
136 | 136 |
137 bool hasLoadedFonts() const { return !m_loadedFonts.isEmpty() || !m_failedFo
nts.isEmpty(); } | 137 bool hasLoadedFonts() const { return !m_loadedFonts.isEmpty() || !m_failedFo
nts.isEmpty(); } |
138 | 138 |
139 bool inActiveDocumentContext() const; | 139 bool inActiveDocumentContext() const; |
140 void forEachInternal(PassOwnPtrWillBeRawPtr<FontFaceSetForEachCallback>, con
st ScriptValue* thisArg) const; | 140 void forEachInternal(FontFaceSetForEachCallback*, const ScriptValue* thisArg
) const; |
141 void addToLoadingFonts(PassRefPtrWillBeRawPtr<FontFace>); | 141 void addToLoadingFonts(PassRefPtrWillBeRawPtr<FontFace>); |
142 void removeFromLoadingFonts(PassRefPtrWillBeRawPtr<FontFace>); | 142 void removeFromLoadingFonts(PassRefPtrWillBeRawPtr<FontFace>); |
143 void fireLoadingEvent(); | 143 void fireLoadingEvent(); |
144 void fireDoneEventIfPossible(); | 144 void fireDoneEventIfPossible(); |
145 bool resolveFontStyle(const String&, Font&); | 145 bool resolveFontStyle(const String&, Font&); |
146 void handlePendingEventsAndPromisesSoon(); | 146 void handlePendingEventsAndPromisesSoon(); |
147 void handlePendingEventsAndPromises(); | 147 void handlePendingEventsAndPromises(); |
148 const WillBeHeapListHashSet<RefPtrWillBeMember<FontFace> >& cssConnectedFont
FaceList() const; | 148 const WillBeHeapListHashSet<RefPtrWillBeMember<FontFace> >& cssConnectedFont
FaceList() const; |
149 bool isCSSConnectedFontFace(FontFace*) const; | 149 bool isCSSConnectedFontFace(FontFace*) const; |
150 | 150 |
151 WillBeHeapHashSet<RefPtrWillBeMember<FontFace> > m_loadingFonts; | 151 WillBeHeapHashSet<RefPtrWillBeMember<FontFace> > m_loadingFonts; |
152 bool m_shouldFireLoadingEvent; | 152 bool m_shouldFireLoadingEvent; |
153 Vector<OwnPtr<FontsReadyPromiseResolver> > m_readyResolvers; | 153 Vector<OwnPtr<FontsReadyPromiseResolver> > m_readyResolvers; |
154 FontFaceArray m_loadedFonts; | 154 FontFaceArray m_loadedFonts; |
155 FontFaceArray m_failedFonts; | 155 FontFaceArray m_failedFonts; |
156 WillBeHeapListHashSet<RefPtrWillBeMember<FontFace> > m_nonCSSConnectedFaces; | 156 WillBeHeapListHashSet<RefPtrWillBeMember<FontFace> > m_nonCSSConnectedFaces; |
157 | 157 |
158 AsyncMethodRunner<FontFaceSet> m_asyncRunner; | 158 AsyncMethodRunner<FontFaceSet> m_asyncRunner; |
159 | 159 |
160 FontLoadHistogram m_histogram; | 160 FontLoadHistogram m_histogram; |
161 }; | 161 }; |
162 | 162 |
163 } // namespace blink | 163 } // namespace blink |
164 | 164 |
165 #endif // FontFaceSet_h | 165 #endif // FontFaceSet_h |
OLD | NEW |