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

Unified Diff: third_party/WebKit/Source/core/fetch/Resource.cpp

Issue 2616323002: CrossOriginAccessControl: separate access checks and error message generation (Closed)
Patch Set: sync expectation Created 3 years, 11 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/fetch/Resource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/Resource.cpp b/third_party/WebKit/Source/core/fetch/Resource.cpp
index 91bc63f6a9e6bec5c9d69e802d8613f5697c6988..b23dff7d18f08dbf625fc677e95bd4fa16b0ab30 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.cpp
+++ b/third_party/WebKit/Source/core/fetch/Resource.cpp
@@ -444,24 +444,21 @@ AtomicString Resource::httpContentType() const {
}
bool Resource::passesAccessControlCheck(SecurityOrigin* securityOrigin) const {
- String ignoredErrorDescription;
- return passesAccessControlCheck(securityOrigin, ignoredErrorDescription);
-}
+ StoredCredentials storedCredentials =
+ lastResourceRequest().allowStoredCredentials()
+ ? AllowStoredCredentials
+ : DoNotAllowStoredCredentials;
+ CrossOriginAccessControl::AccessStatus status =
+ CrossOriginAccessControl::checkAccess(m_response, storedCredentials,
+ securityOrigin);
-bool Resource::passesAccessControlCheck(SecurityOrigin* securityOrigin,
- String& errorDescription) const {
- return blink::passesAccessControlCheck(
- m_response, lastResourceRequest().allowStoredCredentials()
- ? AllowStoredCredentials
- : DoNotAllowStoredCredentials,
- securityOrigin, errorDescription, lastResourceRequest().requestContext());
+ return status == CrossOriginAccessControl::kAccessAllowed;
}
bool Resource::isEligibleForIntegrityCheck(
SecurityOrigin* securityOrigin) const {
- String ignoredErrorDescription;
return securityOrigin->canRequest(resourceRequest().url()) ||
- passesAccessControlCheck(securityOrigin, ignoredErrorDescription);
+ passesAccessControlCheck(securityOrigin);
}
void Resource::setIntegrityDisposition(
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.h ('k') | third_party/WebKit/Source/core/fetch/ResourceLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698