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

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: Test added, failed bot tests fixed, converted to enum. 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..b154fe60d11ad331ece50eceda83d11ff043e346 100644
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.h
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.h
@@ -39,9 +39,9 @@ class LocalFrame;
class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>, public ScriptResourceClient {
USING_GARBAGE_COLLECTED_MIXIN(ScriptLoader);
public:
- static ScriptLoader* create(Element* element, bool createdByParser, bool isEvaluated, bool createdDuringDocumentWrite = false)
+ static ScriptLoader* create(Element* element, bool createdByParser, bool isEvaluated, bool createdDuringDocumentWrite = false, bool blockedDocWriteScriptAsyncFetch = false)
Nate Chapin 2016/08/22 19:47:03 Rather than adding another boolean parameter to a
shivanisha 2016/08/22 20:44:00 Done.
{
- return new ScriptLoader(element, createdByParser, isEvaluated, createdDuringDocumentWrite);
+ return new ScriptLoader(element, createdByParser, isEvaluated, createdDuringDocumentWrite, blockedDocWriteScriptAsyncFetch);
}
~ScriptLoader() override;
@@ -88,8 +88,10 @@ public:
bool wasCreatedDuringDocumentWrite() { return m_createdDuringDocumentWrite; }
+ bool disallowedFetchForDocWrittenScript() { return m_documentWriteIntervention == DocumentWriteIntervention::DisallowedFetchForDocWrittenScript; }
+
protected:
- ScriptLoader(Element*, bool createdByParser, bool isEvaluated, bool createdDuringDocumentWrite);
+ ScriptLoader(Element*, bool createdByParser, bool isEvaluated, bool createdDuringDocumentWrite, bool blockedDocWriteScriptAsyncFetch);
private:
bool ignoresLoadRequest() const;
@@ -121,11 +123,20 @@ 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,
+ // Is it a fetch (non parser-blocking, lowest priority) for the blocked script.
+ AsyncLowPriorityFetchForBlockedScript,
+ };
+
+ DocumentWriteIntervention m_documentWriteIntervention;
+
Member<PendingScript> m_pendingScript;
};
-
Nate Chapin 2016/08/22 19:47:03 Why these deletes?
shivanisha 2016/08/22 20:44:00 reverted.
ScriptLoader* toScriptLoaderIfPossible(Element*);
-
} // namespace blink
#endif // ScriptLoader_h

Powered by Google App Engine
This is Rietveld 408576698