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

Unified Diff: third_party/WebKit/Source/core/loader/resource/ImageResource.cpp

Issue 2676163002: Refactor the forPreload flag to mean speculative preload. (Closed)
Patch Set: Renamed ReportingPolicy and moved comments Created 3 years, 10 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/resource/ImageResource.cpp
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp b/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
index f3c3221bbc7ea871a40579cbb28be63ab2f888d6..1f646e29c5b69c406bc533ef6e73bdc8778b942f 100644
--- a/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
+++ b/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
@@ -155,7 +155,12 @@ ImageResource* ImageResource::fetch(FetchRequest& request,
if (requestURL.isValid()) {
ResourceRequestBlockedReason blockReason = fetcher->context().canRequest(
Resource::Image, request.resourceRequest(), requestURL,
- request.options(), request.forPreload(),
+ request.options(),
+ /* Don't send security violation reports for speculative preloads */
+ request.isSpeculativePreload()
+ ? FetchContext::SecurityViolationReportingPolicy::
+ SuppressReporting
+ : FetchContext::SecurityViolationReportingPolicy::Report,
request.getOriginRestriction());
if (blockReason == ResourceRequestBlockedReason::None)
fetcher->context().sendImagePing(requestURL);

Powered by Google App Engine
This is Rietveld 408576698