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

Unified Diff: Source/core/css/RemoteFontFaceSource.cpp

Issue 316353003: Remove font fetching fallback for CORS failures (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add/Update tests Created 6 years, 6 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/RemoteFontFaceSource.h ('k') | Source/core/fetch/FontResource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/RemoteFontFaceSource.cpp
diff --git a/Source/core/css/RemoteFontFaceSource.cpp b/Source/core/css/RemoteFontFaceSource.cpp
index 5483e8b77fd05e46354c3bfeb28162fb401b4363..4ee1972d266e88d67d2f74f285316a50764f58c5 100644
--- a/Source/core/css/RemoteFontFaceSource.cpp
+++ b/Source/core/css/RemoteFontFaceSource.cpp
@@ -5,11 +5,9 @@
#include "config.h"
#include "core/css/RemoteFontFaceSource.h"
-#include "FetchInitiatorTypeNames.h"
#include "core/css/CSSCustomFontData.h"
#include "core/css/CSSFontFace.h"
-#include "core/css/CSSFontSelector.h"
-#include "core/fetch/ResourceFetcher.h"
+#include "core/css/FontLoader.h"
#include "platform/fonts/FontCache.h"
#include "platform/fonts/FontDescription.h"
#include "platform/fonts/SimpleFontData.h"
@@ -85,28 +83,6 @@ void RemoteFontFaceSource::fontLoadWaitLimitExceeded(FontResource*)
m_histograms.recordFallbackTime(m_font.get());
}
-void RemoteFontFaceSource::corsFailed(FontResource*)
-{
- if (m_face) {
- m_histograms.corsFailed();
- Document* document = m_face->fontSelector() ? m_face->fontSelector()->document() : 0;
- if (document) {
- FetchRequest request(ResourceRequest(m_font->url()), FetchInitiatorTypeNames::css);
- ResourcePtr<FontResource> newFontResource = document->fetcher()->fetchFont(request);
- if (newFontResource) {
- m_font->removeClient(this);
- m_font = newFontResource;
- m_font->addClient(this);
- m_fontLoader->addFontToBeginLoading(m_font.get());
- return;
- } else {
- pruneTable();
- }
- }
- m_face->fontLoaded(this);
- }
-}
-
PassRefPtr<SimpleFontData> RemoteFontFaceSource::createFontData(const FontDescription& fontDescription)
{
if (!isLoaded())
@@ -190,12 +166,6 @@ void RemoteFontFaceSource::FontLoadHistograms::recordRemoteFont(const FontResour
: font->response().wasCached() ? Hit
: Miss;
blink::Platform::current()->histogramEnumeration("WebFont.CacheHit", histogramValue, CacheHitEnumMax);
-
- if (!font->errorOccurred()) {
- enum { CORSFail, CORSSuccess, CORSEnumMax };
- int corsValue = m_corsFailed ? CORSFail : CORSSuccess;
- blink::Platform::current()->histogramEnumeration("WebFont.CORSSuccess", corsValue, CORSEnumMax);
- }
}
}
« no previous file with comments | « Source/core/css/RemoteFontFaceSource.h ('k') | Source/core/fetch/FontResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698