Chromium Code Reviews| 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 |