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

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

Issue 2880733002: Partially implement WorkerFetchContext and WorkerThreadableLoadingContext and add virtual tests (Closed)
Patch Set: incorporated kinuko's comment Created 3 years, 7 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..7031a1942e53ea1ae76dddcee584c27fc5759480 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): Currently we don't support the CORS preflight cache on worker
+ // thread when off-main-thread-fetch is enabled. https://crbug.com/443374
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): Currently we don't support the CORS preflight cache on worker
+ // thread when off-main-thread-fetch is enabled. https://crbug.com/443374
+ CrossOriginPreflightResultCache::Shared().AppendEntry(
+ GetSecurityOrigin()->ToString(), actual_request_.Url(),
+ std::move(preflight_result));
+ }
}
void DocumentThreadableLoader::ReportResponseReceived(

Powered by Google App Engine
This is Rietveld 408576698