| Index: third_party/WebKit/Source/core/dom/PendingScript.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/PendingScript.cpp b/third_party/WebKit/Source/core/dom/PendingScript.cpp
|
| index 8123482b414ab1e8dcbe721e41a147076414b22e..2f4ee12b63c43b52d7361876c4ed76b6fc38f0f4 100644
|
| --- a/third_party/WebKit/Source/core/dom/PendingScript.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/PendingScript.cpp
|
| @@ -52,10 +52,18 @@ PendingScript::PendingScript(Element* element, ScriptResource* resource)
|
| PendingScript::~PendingScript() {}
|
|
|
| void PendingScript::dispose() {
|
| - if (!m_client)
|
| - return;
|
| stopWatchingForLoad();
|
| - releaseElementAndClear();
|
| + DCHECK(!m_client);
|
| + DCHECK(!m_watchingForLoad);
|
| +
|
| + setScriptResource(nullptr);
|
| + m_startingPosition = TextPosition::belowRangePosition();
|
| + m_integrityFailure = false;
|
| + m_parserBlockingLoadStartTime = 0;
|
| + if (m_streamer)
|
| + m_streamer->cancel();
|
| + m_streamer = nullptr;
|
| + m_element = nullptr;
|
| }
|
|
|
| void PendingScript::watchForLoad(ScriptResourceClient* client) {
|
| @@ -91,18 +99,6 @@ void PendingScript::setElement(Element* element) {
|
| m_element = element;
|
| }
|
|
|
| -Element* PendingScript::releaseElementAndClear() {
|
| - setScriptResource(0);
|
| - m_watchingForLoad = false;
|
| - m_startingPosition = TextPosition::belowRangePosition();
|
| - m_integrityFailure = false;
|
| - m_parserBlockingLoadStartTime = 0;
|
| - if (m_streamer)
|
| - m_streamer->cancel();
|
| - m_streamer.release();
|
| - return m_element.release();
|
| -}
|
| -
|
| void PendingScript::setScriptResource(ScriptResource* resource) {
|
| setResource(resource);
|
| }
|
|
|