Chromium Code Reviews| 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..5d400359ac5322f5249f0298ce9f21807af58763 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 preflie cache on worker |
|
kinuko
2017/05/12 08:41:44
preflie -> preflight
horo
2017/05/12 09:06:02
Done.
|
| + // 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 preflie cache on worker |
|
kinuko
2017/05/12 08:41:45
ditto
horo
2017/05/12 09:06:02
Done.
|
| + // 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( |