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

Unified Diff: Source/core/fetch/ResourceFetcher.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/fetch/FontResource.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index 2f9a459fd2363ff5aaa2b5a1c1e8094658e53f26..b8236e857fad82552edd3623d275b10b79a7f0e8 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -220,14 +220,6 @@ static ResourceRequest::TargetType requestTargetType(const ResourceFetcher* fetc
return ResourceRequest::TargetIsSubresource;
}
-static void reportFontResourceCORSFailed(Resource* resource, const KURL& url, LocalFrame* frame)
-{
- FontResource* fontResource = toFontResource(resource);
- fontResource->setCORSFailed();
- if (frame && frame->document())
- frame->document()->addConsoleMessage(JSMessageSource, WarningMessageLevel, "Blink is considering rejecting non spec-compliant cross-origin web font requests: " + url.string() + ". Please use Access-Control-Allow-Origin to make these requests spec-compliant.");
-}
-
ResourceFetcher::ResourceFetcher(DocumentLoader* documentLoader)
: m_document(nullptr)
, m_documentLoader(documentLoader)
@@ -613,12 +605,6 @@ bool ResourceFetcher::canAccessResource(Resource* resource, SecurityOrigin* sour
String errorDescription;
if (!resource->passesAccessControlCheck(sourceOrigin, errorDescription)) {
- // FIXME: Remove later, http://crbug.com/286681
- if (resource->type() == Resource::Font) {
- reportFontResourceCORSFailed(resource, url, frame());
- return false;
- }
-
if (frame() && frame()->document()) {
String resourceType = Resource::resourceTypeToString(resource->type(), resource->options().initiatorInfo);
frame()->document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, resourceType + " from origin '" + SecurityOrigin::create(url)->toString() + "' has been blocked from loading by Cross-Origin Resource Sharing policy: " + errorDescription);
@@ -1371,12 +1357,6 @@ bool ResourceFetcher::canAccessRedirect(Resource* resource, ResourceRequest& req
String errorMessage;
if (!CrossOriginAccessControl::handleRedirect(resource, sourceOrigin, request, redirectResponse, options, errorMessage)) {
- // FIXME: Remove later, http://crbug.com/286681
- if (resource->type() == Resource::Font) {
- reportFontResourceCORSFailed(resource, request.url(), frame());
- return false;
- }
-
if (frame() && frame()->document())
frame()->document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, errorMessage);
return false;
« no previous file with comments | « Source/core/fetch/FontResource.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698