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

Unified Diff: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp

Issue 2231523002: Make ResourceFetcher return Resources with LoadError instead of nullptrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment phrasing. Created 4 years, 3 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
Index: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
index e4caac40bb90dc83ab950f47f4609b065ff58444..abe32fc82d15ac6a3e8c76cf9cdd278fcaee9045 100644
--- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
+++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -1365,7 +1365,12 @@ void XMLHttpRequest::didFail(const ResourceError& error)
if (m_error)
return;
- if (error.isCancellation()) {
+ // Internally, access check violations are considered `cancellations`, but
+ // at least the mixed-content and CSP specs require them to be surfaced as
+ // network errors to the page. See:
+ // [1] https://www.w3.org/TR/mixed-content/#algorithms,
+ // [2] https://www.w3.org/TR/CSP3/#fetch-integration.
+ if (error.isCancellation() && !error.isAccessCheck()) {
handleDidCancel();
return;
}

Powered by Google App Engine
This is Rietveld 408576698