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

Unified Diff: Source/core/loader/DocumentThreadableLoader.cpp

Issue 379113002: Move fetch-related predicates to core/fetch. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 5 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: Source/core/loader/DocumentThreadableLoader.cpp
diff --git a/Source/core/loader/DocumentThreadableLoader.cpp b/Source/core/loader/DocumentThreadableLoader.cpp
index 34c86a52a5fb88db350b7f51faee097dd2028d26..9d5a9c0d771d475f94749c227c9348d1dc8a7e74 100644
--- a/Source/core/loader/DocumentThreadableLoader.cpp
+++ b/Source/core/loader/DocumentThreadableLoader.cpp
@@ -90,7 +90,7 @@ DocumentThreadableLoader::DocumentThreadableLoader(Document& document, Threadabl
const HTTPHeaderMap& headerMap = request.httpHeaderFields();
HTTPHeaderMap::const_iterator end = headerMap.end();
for (HTTPHeaderMap::const_iterator it = headerMap.begin(); it != end; ++it) {
- if (isOnAccessControlSimpleRequestHeaderWhitelist(it->key, it->value))
+ if (CrossOriginAccessControl::isSimpleHeader(it->key, it->value))
m_simpleRequestHeaders.add(it->key, it->value);
}
@@ -120,7 +120,7 @@ void DocumentThreadableLoader::makeCrossOriginAccessRequest(const ResourceReques
return;
}
- if ((m_options.preflightPolicy == ConsiderPreflight && isSimpleCrossOriginAccessRequest(request.httpMethod(), request.httpHeaderFields())) || m_options.preflightPolicy == PreventPreflight) {
+ if ((m_options.preflightPolicy == ConsiderPreflight && CrossOriginAccessControl::isSimpleOrForbiddenRequest(request.httpMethod(), request.httpHeaderFields())) || m_options.preflightPolicy == PreventPreflight) {
sof 2014/07/17 08:18:09 Could we keep this as isSimpleRequest() ?
yhirano 2014/08/06 08:48:03 I think we can't. Blink sometimes insert forbidden
ResourceRequest crossOriginRequest(request);
ResourceLoaderOptions crossOriginOptions(m_resourceLoaderOptions);
updateRequestForAccessControl(crossOriginRequest, securityOrigin(), effectiveAllowCredentials());
@@ -368,8 +368,9 @@ void DocumentThreadableLoader::handleSuccessfulFinish(unsigned long identifier,
ASSERT(!m_sameOriginRequest);
ASSERT(m_options.crossOriginRequestPolicy == UseAccessControl);
loadActualRequest();
- } else
+ } else {
m_client->didFinishLoading(identifier, finishTime);
+ }
}
void DocumentThreadableLoader::didTimeout(Timer<DocumentThreadableLoader>* timer)

Powered by Google App Engine
This is Rietveld 408576698