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

Unified Diff: third_party/WebKit/Source/core/dom/ScriptLoader.cpp

Issue 2693423002: Do not re-initialize PendingScript in HTMLParserScriptRunner (Closed)
Patch Set: Reflect comments Created 3 years, 10 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.cpp
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
index 59c18165977be6808061e6b8025c7f35ef0df0c6..e32b4516f1b353bdf0e889e6dcee3554dd61e551 100644
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
@@ -142,7 +142,7 @@ void ScriptLoader::handleAsyncAttribute() {
m_nonBlocking = false;
}
-void ScriptLoader::detach() {
+void ScriptLoader::detachPendingScript() {
if (!m_pendingScript)
return;
m_pendingScript->dispose();
@@ -817,7 +817,7 @@ void ScriptLoader::execute() {
DCHECK(m_pendingScript->resource());
bool errorOccurred = false;
ScriptSourceCode source = m_pendingScript->getSource(KURL(), errorOccurred);
- m_pendingScript->dispose();
+ detachPendingScript();
if (errorOccurred) {
dispatchErrorEvent();
} else if (!m_resource->wasCanceled()) {
@@ -848,7 +848,7 @@ void ScriptLoader::pendingScriptFinished(PendingScript* pendingScript) {
Document* contextDocument = m_element->document().contextDocument();
if (!contextDocument) {
- detach();
+ detachPendingScript();
return;
}
@@ -857,7 +857,7 @@ void ScriptLoader::pendingScriptFinished(PendingScript* pendingScript) {
if (m_resource->errorOccurred()) {
contextDocument->scriptRunner()->notifyScriptLoadError(this,
m_asyncExecType);
- detach();
+ detachPendingScript();
dispatchErrorEvent();
return;
}

Powered by Google App Engine
This is Rietveld 408576698