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

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

Issue 2389753002: doc.write blocking intervention warning header (Closed)
Patch Set: Feedback incorporated Created 4 years, 2 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/FrameFetchContext.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
index 7fccf4bb176bb95e82ed23de68978db6595626f3..cb915bf05363b9267588ac97f421b6cc8fc0b571 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -107,7 +107,7 @@ bool isConnectionEffectively2G(WebEffectiveConnectionType effectiveType) {
return false;
}
-bool shouldDisallowFetchForMainFrameScript(const ResourceRequest& request,
+bool shouldDisallowFetchForMainFrameScript(ResourceRequest& request,
FetchRequest::DeferOption defer,
Document& document) {
// Only scripts inserted via document.write are candidates for having their
@@ -151,6 +151,9 @@ bool shouldDisallowFetchForMainFrameScript(const ResourceRequest& request,
return false;
emitWarningForDocWriteScripts(request.url().getString(), document);
+ request.setHTTPHeaderField("Intervention",
+ "<https://www.chromestatus.com/feature/"
+ "5718547946799104>; level=\"warning\"");
// Do not block scripts if it is a page reload. This is to enable pages to
// recover if blocking of a script is leading to a page break and the user
@@ -295,7 +298,7 @@ static WebCachePolicy memoryCachePolicyToResourceRequestCachePolicy(
}
WebCachePolicy FrameFetchContext::resourceRequestCachePolicy(
- const ResourceRequest& request,
+ ResourceRequest& request,
Resource::Type type,
FetchRequest::DeferOption defer) const {
DCHECK(frame());
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.h ('k') | third_party/WebKit/Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698