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 24f3ebd7e0b67ad6d76412f07751c1a0f73a65fe..251a55a9b3f30dccff0bce1665fa462decf8f399 100644 |
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.h |
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.h |
@@ -88,6 +88,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); |
@@ -121,6 +124,21 @@ private: |
bool m_forceAsync : 1; |
const bool m_createdDuringDocumentWrite : 1; |
+ 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, |
haraken
2016/09/07 01:47:36
FetchDocWrittenScriptInIdleTask ?
shivanisha
2016/09/15 20:35:08
used DeferIdle in the name to convey the usage of
|
+ }; |
+ |
+ DocumentWriteIntervention m_documentWriteIntervention; |
+ |
Member<PendingScript> m_pendingScript; |
}; |