Index: third_party/WebKit/Source/core/dom/ScriptLoader.h |
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.h b/third_party/WebKit/Source/core/dom/ScriptLoader.h |
index 0982c1f148680b37a334b28a8e7e76de878975ea..a85a59917532c40853aa6d1e6616c4dd9a1e0ca5 100644 |
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.h |
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.h |
@@ -91,6 +91,9 @@ public: |
bool wasCreatedDuringDocumentWrite() { return m_createdDuringDocumentWrite; } |
+ bool disallowedFetchForDocWrittenScript() { return m_documentWriteIntervention == DocumentWriteIntervention::DoNotFetchDocWrittenScript; } |
+ void setFetchDocWrittenScriptDeferIdle(); |
+ |
protected: |
ScriptLoader(Element*, bool createdByParser, bool isEvaluated, bool createdDuringDocumentWrite); |
@@ -125,6 +128,20 @@ private: |
const bool m_createdDuringDocumentWrite : 1; |
ScriptRunner::AsyncExecutionType m_asyncExecType; |
+ enum DocumentWriteIntervention { |
+ DocumentWriteInterventionNone = 0, |
+ // Based on what shouldDisallowFetchForMainFrameScript() returns. |
+ // This script will be blocked if not present in http cache. |
+ DoNotFetchDocWrittenScript, |
+ // If a parser blocking doc.written script was not fetched and was not |
+ // present in the http cache, send a GET for it with an interventions |
+ // header to allow the server to know of the intervention. This fetch |
+ // will be using DeferOption::IdleLoad to keep it out of the critical |
+ // path. |
+ FetchDocWrittenScriptDeferIdle, |
+ }; |
+ |
+ DocumentWriteIntervention m_documentWriteIntervention; |
Member<PendingScript> m_pendingScript; |
}; |