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

Unified Diff: Source/core/fetch/FontResource.h

Issue 171823002: Make text visible when font loading takes longer than 3 seconds (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 10 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
« no previous file with comments | « Source/core/css/CSSSegmentedFontFace.cpp ('k') | Source/core/fetch/FontResource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/FontResource.h
diff --git a/Source/core/fetch/FontResource.h b/Source/core/fetch/FontResource.h
index 306d20477d21323f32f2304d683a5615a058ed58..a6a0a93fcdfb39c33d77d5056cf8bf34ea25ecf9 100644
--- a/Source/core/fetch/FontResource.h
+++ b/Source/core/fetch/FontResource.h
@@ -28,6 +28,7 @@
#include "core/fetch/ResourceClient.h"
#include "core/fetch/ResourcePtr.h"
+#include "platform/Timer.h"
#include "platform/fonts/FontOrientation.h"
#include "platform/fonts/FontWidthVariant.h"
#include "wtf/OwnPtr.h"
@@ -54,6 +55,7 @@ public:
virtual void allClientsRemoved() OVERRIDE;
void beginLoadIfNeeded(ResourceFetcher* dl);
virtual bool stillNeedsLoad() const OVERRIDE { return !m_loadInitiated; }
+ bool exceedsFontLoadWaitLimit() const { return m_exceedsFontLoadWaitLimit; }
bool ensureCustomFontData();
FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth);
@@ -65,8 +67,12 @@ public:
private:
virtual void checkNotify() OVERRIDE;
+ void fontLoadWaitLimitCallback(Timer<FontResource>*);
+
OwnPtr<FontCustomPlatformData> m_fontData;
bool m_loadInitiated;
+ bool m_exceedsFontLoadWaitLimit;
+ Timer<FontResource> m_fontLoadWaitLimitTimer;
#if ENABLE(SVG_FONTS)
RefPtr<WebCore::SVGDocument> m_externalSVGDocument;
@@ -84,6 +90,7 @@ public:
virtual ResourceClientType resourceClientType() const OVERRIDE FINAL { return expectedType(); }
virtual void fontLoaded(FontResource*) { }
virtual void didStartFontLoad(FontResource*) { }
+ virtual void fontLoadWaitLimitExceeded(FontResource*) { }
};
}
« no previous file with comments | « Source/core/css/CSSSegmentedFontFace.cpp ('k') | Source/core/fetch/FontResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698