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

Unified Diff: Source/core/html/imports/HTMLImportLoader.cpp

Issue 535403002: introduce DocumentParserClient to receive parser stopped notification (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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: Source/core/html/imports/HTMLImportLoader.cpp
diff --git a/Source/core/html/imports/HTMLImportLoader.cpp b/Source/core/html/imports/HTMLImportLoader.cpp
index 0eec874bd4a38a47e3a229de24af495699b93538..a80db740166613d80a6d710c7bf300c16018b253 100644
--- a/Source/core/html/imports/HTMLImportLoader.cpp
+++ b/Source/core/html/imports/HTMLImportLoader.cpp
@@ -32,6 +32,7 @@
#include "core/html/imports/HTMLImportLoader.h"
#include "core/dom/Document.h"
+#include "core/dom/DocumentParser.h"
#include "core/dom/StyleEngine.h"
#include "core/dom/custom/CustomElementSyncMicrotaskQueue.h"
#include "core/html/HTMLDocument.h"
@@ -116,6 +117,10 @@ HTMLImportLoader::State HTMLImportLoader::startWritingAndParsing(const ResourceR
m_document = HTMLDocument::create(init);
m_writer = DocumentWriter::create(m_document.get(), response.mimeType(), "UTF-8");
+ DocumentParser* parser = m_document->parser();
+ ASSERT(parser);
+ parser->addClient(this);
+
return StateLoading;
}
@@ -151,11 +156,15 @@ void HTMLImportLoader::setState(State state)
didFinishLoading();
}
-void HTMLImportLoader::didFinishParsing()
+void HTMLImportLoader::notifyParserStopped()
{
setState(finishParsing());
if (!hasPendingResources())
setState(finishLoading());
+
+ DocumentParser* parser = m_document->parser();
+ ASSERT(parser);
+ parser->removeClient(this);
}
void HTMLImportLoader::didRemoveAllPendingStylesheet()

Powered by Google App Engine
This is Rietveld 408576698