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

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

Issue 2816403002: test all
Patch Set: fix sharedworker Created 3 years, 8 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/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);
}
« no previous file with comments | « third_party/WebKit/Source/core/loader/BUILD.gn ('k') | third_party/WebKit/Source/core/loader/FrameFetchContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698