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

Unified Diff: third_party/WebKit/Source/core/dom/ScriptLoader.cpp

Issue 2740253002: Remove FetchRequest::mutableResourceRequest() where removing is trivial (Closed)
Patch Set: Fix Created 3 years, 9 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/dom/ScriptLoader.cpp
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
index 0a9402b302f3e530645f10d5a6397add4059de80..54c374997963907b76b8fd1d7bd5b91d737fa1ba 100644
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
@@ -523,9 +523,17 @@ bool ScriptLoader::fetchScript(const String& sourceUrl,
// 21. "If the element has a src content attribute, run these substeps:"
if (!stripLeadingAndTrailingHTMLSpaces(sourceUrl).isEmpty()) {
// 21.4. "Parse src relative to the element's node document."
- FetchRequest request(
- ResourceRequest(elementDocument->completeURL(sourceUrl)),
- m_element->localName());
+ ResourceRequest resourceRequest(elementDocument->completeURL(sourceUrl));
+
+ // [Intervention]
+ if (m_documentWriteIntervention ==
+ DocumentWriteIntervention::FetchDocWrittenScriptDeferIdle) {
+ resourceRequest.setHTTPHeaderField(
+ "Intervention",
+ "<https://www.chromestatus.com/feature/5718547946799104>");
+ }
+
+ FetchRequest request(resourceRequest, m_element->localName());
// 15. "Let CORS setting be the current state of the element's
// crossorigin content attribute."
@@ -570,14 +578,6 @@ bool ScriptLoader::fetchScript(const String& sourceUrl,
request.setIntegrityMetadata(metadataSet);
}
- // [Intervention]
- if (m_documentWriteIntervention ==
- DocumentWriteIntervention::FetchDocWrittenScriptDeferIdle) {
- request.mutableResourceRequest().setHTTPHeaderField(
- "Intervention",
- "<https://www.chromestatus.com/feature/5718547946799104>");
- }
-
// 21.6. "Switch on the script's type:"
// - "classic":

Powered by Google App Engine
This is Rietveld 408576698