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

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: Created 6 years, 4 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/loader/CrossOriginPreflightResultCache.cpp ('k') | Source/core/xml/XMLHttpRequest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/DocumentThreadableLoader.cpp
diff --git a/Source/core/loader/DocumentThreadableLoader.cpp b/Source/core/loader/DocumentThreadableLoader.cpp
index f49558151d8a1e25d4e91e85b2909f2d7cfad76b..e1a3517243ccfbd4c1ccb18a0fb7383457476711 100644
--- a/Source/core/loader/DocumentThreadableLoader.cpp
+++ b/Source/core/loader/DocumentThreadableLoader.cpp
@@ -35,6 +35,7 @@
#include "core/dom/Document.h"
#include "core/fetch/CrossOriginAccessControl.h"
#include "core/fetch/FetchRequest.h"
+#include "core/fetch/FetchUtils.h"
#include "core/fetch/Resource.h"
#include "core/fetch/ResourceFetcher.h"
#include "core/frame/LocalFrame.h"
@@ -90,7 +91,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 (FetchUtils::isSimpleHeader(it->key, it->value))
m_simpleRequestHeaders.add(it->key, it->value);
}
@@ -120,7 +121,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 && FetchUtils::isSimpleOrForbiddenRequest(request.httpMethod(), request.httpHeaderFields())) || m_options.preflightPolicy == PreventPreflight) {
ResourceRequest crossOriginRequest(request);
ResourceLoaderOptions crossOriginOptions(m_resourceLoaderOptions);
updateRequestForAccessControl(crossOriginRequest, securityOrigin(), effectiveAllowCredentials());
@@ -394,8 +395,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)
« no previous file with comments | « Source/core/loader/CrossOriginPreflightResultCache.cpp ('k') | Source/core/xml/XMLHttpRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698