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

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

Issue 230383003: Webfont CORS-enabled fetching with fallback (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase & reverse the enum values Created 6 years, 8 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/fetch/FontResource.h ('k') | Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/FontResource.cpp
diff --git a/Source/core/fetch/FontResource.cpp b/Source/core/fetch/FontResource.cpp
index 0a0138d10236ad804099fbf37f20d5237eec6bc0..05db84052fe1b02dc0f573ac6592967a918e6796 100644
--- a/Source/core/fetch/FontResource.cpp
+++ b/Source/core/fetch/FontResource.cpp
@@ -50,6 +50,7 @@ FontResource::FontResource(const ResourceRequest& resourceRequest)
: Resource(resourceRequest, Font)
, m_loadInitiated(false)
, m_exceedsFontLoadWaitLimit(false)
+ , m_corsFailed(false)
, m_fontLoadWaitLimitTimer(this, &FontResource::fontLoadWaitLimitCallback)
{
}
@@ -184,9 +185,16 @@ void FontResource::allClientsRemoved()
void FontResource::checkNotify()
{
m_fontLoadWaitLimitTimer.stop();
+
ResourceClientWalker<FontResourceClient> w(m_clients);
- while (FontResourceClient* c = w.next())
- c->fontLoaded(this);
+ // FIXME: Remove this CORS fallback once we have enough UMA to make a decision.
+ if (m_corsFailed) {
+ while (FontResourceClient* client = w.next())
+ client->corsFailed(this);
+ } else {
+ while (FontResourceClient* c = w.next())
+ c->fontLoaded(this);
+ }
}
}
« no previous file with comments | « Source/core/fetch/FontResource.h ('k') | Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698