Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Side by Side Diff: Source/core/css/FontFaceSet.h

Issue 1313853003: CSS Font Loading: FontFaceSet.ready should return the same promise each time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 class CSSFontFace; 49 class CSSFontFace;
50 class CSSFontFaceSource; 50 class CSSFontFaceSource;
51 class CSSFontSelector; 51 class CSSFontSelector;
52 class Dictionary; 52 class Dictionary;
53 class Document; 53 class Document;
54 class ExceptionState; 54 class ExceptionState;
55 class Font; 55 class Font;
56 class FontFaceCache; 56 class FontFaceCache;
57 class FontResource; 57 class FontResource;
58 class FontsReadyPromiseResolver;
59 class ExecutionContext; 58 class ExecutionContext;
60 59
61 #if ENABLE(OILPAN) 60 #if ENABLE(OILPAN)
62 class FontFaceSet final : public EventTargetWithInlineData, public HeapSupplemen t<Document>, public ActiveDOMObject { 61 class FontFaceSet final : public EventTargetWithInlineData, public HeapSupplemen t<Document>, public ActiveDOMObject {
63 USING_GARBAGE_COLLECTED_MIXIN(FontFaceSet); 62 USING_GARBAGE_COLLECTED_MIXIN(FontFaceSet);
64 typedef HeapSupplement<Document> SupplementType; 63 typedef HeapSupplement<Document> SupplementType;
65 #else 64 #else
66 class FontFaceSet final : public EventTargetWithInlineData, public RefCountedSup plement<Document, FontFaceSet>, public ActiveDOMObject { 65 class FontFaceSet final : public EventTargetWithInlineData, public RefCountedSup plement<Document, FontFaceSet>, public ActiveDOMObject {
67 REFCOUNTED_EVENT_TARGET(FontFaceSet); 66 REFCOUNTED_EVENT_TARGET(FontFaceSet);
68 typedef RefCountedSupplement<Document, FontFaceSet> SupplementType; 67 typedef RefCountedSupplement<Document, FontFaceSet> SupplementType;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 void forEachInternal(FontFaceSetForEachCallback*, const ScriptValue* thisArg ) const; 137 void forEachInternal(FontFaceSetForEachCallback*, const ScriptValue* thisArg ) const;
139 void addToLoadingFonts(PassRefPtrWillBeRawPtr<FontFace>); 138 void addToLoadingFonts(PassRefPtrWillBeRawPtr<FontFace>);
140 void removeFromLoadingFonts(PassRefPtrWillBeRawPtr<FontFace>); 139 void removeFromLoadingFonts(PassRefPtrWillBeRawPtr<FontFace>);
141 void fireLoadingEvent(); 140 void fireLoadingEvent();
142 void fireDoneEventIfPossible(); 141 void fireDoneEventIfPossible();
143 bool resolveFontStyle(const String&, Font&); 142 bool resolveFontStyle(const String&, Font&);
144 void handlePendingEventsAndPromisesSoon(); 143 void handlePendingEventsAndPromisesSoon();
145 void handlePendingEventsAndPromises(); 144 void handlePendingEventsAndPromises();
146 const WillBeHeapListHashSet<RefPtrWillBeMember<FontFace>>& cssConnectedFontF aceList() const; 145 const WillBeHeapListHashSet<RefPtrWillBeMember<FontFace>>& cssConnectedFontF aceList() const;
147 bool isCSSConnectedFontFace(FontFace*) const; 146 bool isCSSConnectedFontFace(FontFace*) const;
147 bool shouldSignalReady() const;
148
149 typedef ScriptPromiseProperty<RawPtrWillBeMember<FontFaceSet>, RawPtrWillBeM ember<FontFaceSet>, Member<DOMException>> ReadyProperty;
148 150
149 WillBeHeapHashSet<RefPtrWillBeMember<FontFace>> m_loadingFonts; 151 WillBeHeapHashSet<RefPtrWillBeMember<FontFace>> m_loadingFonts;
150 bool m_shouldFireLoadingEvent; 152 bool m_shouldFireLoadingEvent;
151 bool m_isLoading; 153 bool m_isLoading;
152 PersistentHeapVectorWillBeHeapVector<Member<FontsReadyPromiseResolver>> m_re adyResolvers; 154 PersistentWillBeMember<ReadyProperty> m_ready;
153 FontFaceArray m_loadedFonts; 155 FontFaceArray m_loadedFonts;
154 FontFaceArray m_failedFonts; 156 FontFaceArray m_failedFonts;
155 WillBeHeapListHashSet<RefPtrWillBeMember<FontFace>> m_nonCSSConnectedFaces; 157 WillBeHeapListHashSet<RefPtrWillBeMember<FontFace>> m_nonCSSConnectedFaces;
156 158
157 AsyncMethodRunner<FontFaceSet> m_asyncRunner; 159 AsyncMethodRunner<FontFaceSet> m_asyncRunner;
158 160
159 FontLoadHistogram m_histogram; 161 FontLoadHistogram m_histogram;
160 }; 162 };
161 163
162 } // namespace blink 164 } // namespace blink
163 165
164 #endif // FontFaceSet_h 166 #endif // FontFaceSet_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698