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

Unified Diff: Source/core/css/FontFace.h

Issue 196383035: Fix promise resolution of FontFaceSet#load() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/css/FontFace.h
diff --git a/Source/core/css/FontFace.h b/Source/core/css/FontFace.h
index 06c0d85be0b85112cf804a842eaef149cd8000cd..517a816114856e3fd60b0b3c47bd851e69b89fba 100644
--- a/Source/core/css/FontFace.h
+++ b/Source/core/css/FontFace.h
@@ -93,6 +93,14 @@ public:
bool hadBlankText() const;
+ class LoadFontCallback : public RefCounted<LoadFontCallback> {
+ public:
+ virtual ~LoadFontCallback() { }
+ virtual void notifyLoaded(FontFace*) = 0;
+ virtual void notifyError(FontFace*) = 0;
+ };
+ void load(PassRefPtr<LoadFontCallback>, ExecutionContext*);
dglazkov 2014/03/19 15:42:34 "Load" overload :) You even have loadInternal now
Kunihiko Sakamoto 2014/03/20 01:06:32 Renamed to loadWithCallback.
+
private:
FontFace();
@@ -103,6 +111,7 @@ private:
bool setPropertyValue(PassRefPtrWillBeRawPtr<CSSValue>, CSSPropertyID);
bool setFamilyValue(CSSValueList*);
void resolveReadyPromises();
+ void loadInternal(ExecutionContext*);
AtomicString m_family;
RefPtrWillBeMember<CSSValue> m_src;
@@ -117,6 +126,7 @@ private:
Vector<OwnPtr<FontFaceReadyPromiseResolver> > m_readyResolvers;
OwnPtr<CSSFontFace> m_cssFontFace;
+ Vector<RefPtr<LoadFontCallback> > m_callbacks;
};
typedef Vector<RefPtr<FontFace> > FontFaceArray;

Powered by Google App Engine
This is Rietveld 408576698