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

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

Issue 2260303002: Sending an async GET request for doc.written blocked scripts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 4 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.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;
};

Powered by Google App Engine
This is Rietveld 408576698