Index: third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp |
diff --git a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp |
index 07ae3e3795a89e8755350dd2aa2908ddea0a5294..096306e2913c4ac2b66be335a1ff4e25975205cd 100644 |
--- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp |
+++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp |
@@ -390,7 +390,10 @@ void DocumentThreadableLoader::makeCrossOriginAccessRequest( |
bool shouldForcePreflight = request.isExternalRequest(); |
if (!shouldForcePreflight) |
probe::shouldForceCORSPreflight(document(), &shouldForcePreflight); |
+ // TODO(horo): Move CrossOriginPreflightResultCache to |
+ // ThreadableLoadingContext |
bool canSkipPreflight = |
+ isMainThread() && |
CrossOriginPreflightResultCache::shared().canSkipPreflight( |
getSecurityOrigin()->toString(), crossOriginRequest.url(), |
effectiveAllowCredentials(), crossOriginRequest.httpMethod(), |
@@ -762,10 +765,13 @@ void DocumentThreadableLoader::handlePreflightResponse( |
accessControlErrorDescription); |
return; |
} |
- |
- CrossOriginPreflightResultCache::shared().appendEntry( |
- getSecurityOrigin()->toString(), m_actualRequest.url(), |
- std::move(preflightResult)); |
+ if (isMainThread()) { |
+ // TODO(horo): Move CrossOriginPreflightResultCache to |
+ // ThreadableLoadingContext |
+ CrossOriginPreflightResultCache::shared().appendEntry( |
+ getSecurityOrigin()->toString(), m_actualRequest.url(), |
+ std::move(preflightResult)); |
+ } |
} |
void DocumentThreadableLoader::reportResponseReceived( |
@@ -775,7 +781,7 @@ void DocumentThreadableLoader::reportResponseReceived( |
if (!frame) |
return; |
DocumentLoader* loader = frame->loader().documentLoader(); |
- probe::didReceiveResourceResponse(frame, identifier, loader, response, |
+ probe::didReceiveResourceResponse(document(), identifier, loader, response, |
resource()); |
frame->console().reportResourceResponseReceived(loader, identifier, response); |
} |