Chromium Code Reviews| Index: Source/core/dom/PendingScript.cpp |
| diff --git a/Source/core/dom/PendingScript.cpp b/Source/core/dom/PendingScript.cpp |
| index 3808001d912aeea101fb1da68546781926476da4..426a35172fa6a0db2f1bd96108468a9d94cfc0da 100644 |
| --- a/Source/core/dom/PendingScript.cpp |
| +++ b/Source/core/dom/PendingScript.cpp |
| @@ -26,6 +26,7 @@ |
| #include "config.h" |
| #include "core/dom/PendingScript.h" |
| +#include "bindings/core/v8/V8ScriptStreamer.h" |
| #include "core/dom/Element.h" |
| #include "core/fetch/ScriptResource.h" |
| @@ -33,6 +34,8 @@ namespace blink { |
| PendingScript::~PendingScript() |
| { |
| + if (m_streamer) |
| + m_streamer->cancel(); |
|
haraken
2014/08/17 16:05:28
Doing something non-trivial in a destructor is lik
marja
2014/08/20 11:45:56
This code turned out to be unnecessary after I ref
|
| } |
| PassRefPtrWillBeRawPtr<Element> PendingScript::releaseElementAndClear() |
| @@ -45,11 +48,22 @@ PassRefPtrWillBeRawPtr<Element> PendingScript::releaseElementAndClear() |
| void PendingScript::setScriptResource(ScriptResource* resource) |
| { |
| + ASSERT(!m_streamer); |
| setResource(resource); |
| } |
| void PendingScript::notifyFinished(Resource*) |
| { |
| + if (m_streamer) { |
| + m_streamer->notifyFinished(); |
| + } |
| +} |
| + |
| +void PendingScript::notifyAppendData(ScriptResource*) |
| +{ |
| + if (m_streamer) { |
| + m_streamer->notifyAppendData(); |
| + } |
| } |
| void PendingScript::trace(Visitor* visitor) |
| @@ -57,4 +71,9 @@ void PendingScript::trace(Visitor* visitor) |
| visitor->trace(m_element); |
| } |
| +bool PendingScript::isStreaming() const |
| +{ |
| + return m_streamer && m_streamer->streamingInProgress(); |
| +} |
| + |
| } |