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

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

Issue 457273002: Webfonts should not block load event for more than one frame (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merge flags into an enum Created 6 years, 4 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/FontLoader.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 103961117ced5f5435871e9f5374bcc924cf1745..07401b96304c08d34a8bb206ec93a7e46c0be596 100644
--- a/Source/core/fetch/FontResource.h
+++ b/Source/core/fetch/FontResource.h
@@ -55,9 +55,13 @@ public:
virtual void allClientsRemoved() OVERRIDE;
void beginLoadIfNeeded(ResourceFetcher* dl);
- virtual bool stillNeedsLoad() const OVERRIDE { return !m_loadInitiated; }
+ virtual bool stillNeedsLoad() const OVERRIDE { return m_state != LoadInitiated; }
bool exceedsFontLoadWaitLimit() const { return m_exceedsFontLoadWaitLimit; }
+ bool loadScheduled() const { return m_state != Unloaded; }
+ void didScheduleLoad();
+ void didUnscheduleLoad();
+
void setCORSFailed() { m_corsFailed = true; }
bool isCORSFailed() const { return m_corsFailed; }
@@ -76,8 +80,10 @@ private:
virtual void checkNotify() OVERRIDE;
void fontLoadWaitLimitCallback(Timer<FontResource>*);
+ enum State { Unloaded, LoadScheduled, LoadInitiated };
+
OwnPtr<FontCustomPlatformData> m_fontData;
- bool m_loadInitiated;
+ State m_state;
bool m_exceedsFontLoadWaitLimit;
bool m_corsFailed;
Timer<FontResource> m_fontLoadWaitLimitTimer;
« no previous file with comments | « Source/core/css/FontLoader.cpp ('k') | Source/core/fetch/FontResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698