Chromium Code Reviews| 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..0d56bfe2f6f27040b8c15001b9fb8e0eceba847b 100644 |
| --- a/third_party/WebKit/Source/core/dom/PendingScript.cpp |
| +++ b/third_party/WebKit/Source/core/dom/PendingScript.cpp |
| @@ -52,10 +52,19 @@ PendingScript::PendingScript(Element* element, ScriptResource* resource) |
| PendingScript::~PendingScript() {} |
| void PendingScript::dispose() { |
| - if (!m_client) |
| - return; |
| - stopWatchingForLoad(); |
| - releaseElementAndClear(); |
| + if (m_client) |
|
sof
2016/11/28 16:17:59
stopWatchingForLoad() already checks for not being
kouhei (in TOK)
2016/11/29 00:49:05
Done.
|
| + stopWatchingForLoad(); |
| + |
| + DCHECK(!m_client); |
| + setScriptResource(nullptr); |
| + m_watchingForLoad = false; |
|
sof
2016/11/28 16:17:59
This ought to be redundant now.
kouhei (in TOK)
2016/11/29 00:49:04
Done.
|
| + 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 +100,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); |
| } |