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 e4c39255ed614560fbdab5bc14d63cfce65d0556..e88f6ec8939131bea00839a97c129b187dd56571 100644 |
--- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp |
+++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp |
@@ -393,7 +393,10 @@ void DocumentThreadableLoader::MakeCrossOriginAccessRequest( |
bool should_force_preflight = request.IsExternalRequest(); |
if (!should_force_preflight) |
probe::shouldForceCORSPreflight(GetDocument(), &should_force_preflight); |
+ // TODO(horo): Move CrossOriginPreflightResultCache to |
+ // ThreadableLoadingContext |
bool can_skip_preflight = |
+ IsMainThread() && |
CrossOriginPreflightResultCache::Shared().CanSkipPreflight( |
GetSecurityOrigin()->ToString(), cross_origin_request.Url(), |
EffectiveAllowCredentials(), cross_origin_request.HttpMethod(), |
@@ -769,9 +772,13 @@ void DocumentThreadableLoader::HandlePreflightResponse( |
return; |
} |
- CrossOriginPreflightResultCache::Shared().AppendEntry( |
- GetSecurityOrigin()->ToString(), actual_request_.Url(), |
- std::move(preflight_result)); |
+ if (IsMainThread()) { |
+ // TODO(horo): Move CrossOriginPreflightResultCache to |
+ // ThreadableLoadingContext |
+ CrossOriginPreflightResultCache::Shared().AppendEntry( |
+ GetSecurityOrigin()->ToString(), actual_request_.Url(), |
+ std::move(preflight_result)); |
+ } |
} |
void DocumentThreadableLoader::ReportResponseReceived( |
@@ -781,7 +788,7 @@ void DocumentThreadableLoader::ReportResponseReceived( |
if (!frame) |
return; |
DocumentLoader* loader = frame->Loader().GetDocumentLoader(); |
- probe::didReceiveResourceResponse(frame, identifier, loader, response, |
+ probe::didReceiveResourceResponse(GetDocument(), identifier, loader, response, |
GetResource()); |
frame->Console().ReportResourceResponseReceived(loader, identifier, response); |
} |