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

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: Nate's feedback 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..1308605c5f042aa2ce06c1216f6b9a54201ffa59 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::DisallowedFetchForDocWrittenScript; }
haraken 2016/08/23 00:30:39 disallowedFetchForDocWrittenScript => shouldFetchD
shivanisha 2016/08/24 17:47:40 Named it as disallowedFetchForDocWrittenScript so
+ void setBlockedDocWriteScriptAsyncFetch();
haraken 2016/08/23 00:30:39 "BlockedDocWrite" sounds a bit strange to me. Is t
shivanisha 2016/08/24 17:47:40 Here blocking is used not in the sense of parser-b
+
protected:
ScriptLoader(Element*, bool createdByParser, bool isEvaluated, bool createdDuringDocumentWrite);
@@ -121,6 +124,17 @@ 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.
+ DisallowedFetchForDocWrittenScript,
haraken 2016/08/23 00:30:39 DoNotFetchDocWrittenScript ?
shivanisha 2016/08/24 17:47:40 Named such so that it is consistent with shouldDis
+ // Is it a fetch (non parser-blocking, lowest priority) for the blocked script.
+ AsyncLowPriorityFetchForBlockedScript,
haraken 2016/08/23 00:30:39 FetchDocWrittenScriptAsynchrously ?
shivanisha 2016/08/24 17:47:40 Wanted to say that it is a fetch for a script whos
+ };
+
+ DocumentWriteIntervention m_documentWriteIntervention;
+
Member<PendingScript> m_pendingScript;
};

Powered by Google App Engine
This is Rietveld 408576698