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

Unified Diff: third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp

Issue 2790693002: Split CSP into pre- and post-upgrade checks (Closed)
Patch Set: add mkwst TODO 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/platform/loader/fetch/ResourceFetcher.cpp
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
index 1816f8d687c68baf6db35b3566b50c292c224325..b1de8329c20192e8c7d6a784b635baefb724be7f 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
@@ -500,9 +500,15 @@ ResourceFetcher::PrepareRequestResult ResourceFetcher::PrepareRequest(
factory.GetType() == Resource::kRaw ||
factory.GetType() == Resource::kXSLStyleSheet);
+ SecurityViolationReportingPolicy reporting_policy =
+ params.IsSpeculativePreload()
+ ? SecurityViolationReportingPolicy::kSuppressReporting
+ : SecurityViolationReportingPolicy::kReport;
Context().PopulateResourceRequest(
+ MemoryCache::RemoveFragmentIdentifierIfNeeded(params.Url()),
factory.GetType(), params.GetClientHintsPreferences(),
- params.GetResourceWidth(), resource_request);
+ params.GetResourceWidth(), params.Options(), reporting_policy,
+ resource_request);
if (!params.Url().IsValid())
return kAbort;
@@ -521,10 +527,7 @@ ResourceFetcher::PrepareRequestResult ResourceFetcher::PrepareRequest(
MemoryCache::RemoveFragmentIdentifierIfNeeded(params.Url()),
params.Options(),
/* Don't send security violation reports for speculative preloads */
- params.IsSpeculativePreload()
- ? SecurityViolationReportingPolicy::kSuppressReporting
- : SecurityViolationReportingPolicy::kReport,
- params.GetOriginRestriction());
+ reporting_policy, params.GetOriginRestriction());
if (blocked_reason != ResourceRequestBlockedReason::kNone) {
DCHECK(!substitute_data.ForceSynchronousLoad());
return kBlock;

Powered by Google App Engine
This is Rietveld 408576698