| Index: third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
|
| index 9b90b6de24f9d77ad71e1bc82165d304489cfb34..80f5c230a6944b5491b1c1372e8246f6ea88a9bc 100644
|
| --- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
|
| +++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
|
| @@ -149,7 +149,6 @@
|
| , m_xssAuditorDelegate(&document)
|
| , m_weakFactory(this)
|
| , m_preloader(HTMLResourcePreloader::create(document))
|
| - , m_parsedChunkQueue(ParsedChunkQueue::create())
|
| , m_shouldUseThreading(syncPolicy == AllowAsynchronousParsing)
|
| , m_endWasDelayed(false)
|
| , m_haveBackgroundParser(false)
|
| @@ -356,13 +355,9 @@
|
| return true;
|
| }
|
|
|
| -void HTMLDocumentParser::notifyPendingParsedChunks()
|
| -{
|
| - TRACE_EVENT0("blink", "HTMLDocumentParser::notifyPendingParsedChunks");
|
| - ASSERT(m_parsedChunkQueue);
|
| -
|
| - Vector<OwnPtr<ParsedChunk>> pendingChunks;
|
| - m_parsedChunkQueue->takeAll(pendingChunks);
|
| +void HTMLDocumentParser::didReceiveParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk> chunk)
|
| +{
|
| + TRACE_EVENT0("blink", "HTMLDocumentParser::didReceiveParsedChunkFromBackgroundParser");
|
|
|
| if (!isParsing())
|
| return;
|
| @@ -371,21 +366,17 @@
|
| // We suspend preload until HTMLHTMLElement is inserted and
|
| // ApplicationCache is initialized.
|
| if (!document()->documentElement()) {
|
| - for (auto& chunk : pendingChunks) {
|
| - for (auto& request : chunk->preloads)
|
| - m_queuedPreloads.append(request.release());
|
| - }
|
| + for (auto& request : chunk->preloads)
|
| + m_queuedPreloads.append(request.release());
|
| } else {
|
| // We can safely assume that there are no queued preloads request after
|
| // the document element is available, as we empty the queue immediately
|
| // after the document element is created in pumpPendingSpeculations().
|
| ASSERT(m_queuedPreloads.isEmpty());
|
| - for (auto& chunk : pendingChunks)
|
| - m_preloader->takeAndPreload(chunk->preloads);
|
| - }
|
| -
|
| - for (auto& chunk : pendingChunks)
|
| - m_speculations.append(chunk.release());
|
| + m_preloader->takeAndPreload(chunk->preloads);
|
| + }
|
| +
|
| + m_speculations.append(chunk);
|
|
|
| if (!isWaitingForScripts() && !isScheduledForResume()) {
|
| if (m_tasksWereSuspended)
|
| @@ -803,7 +794,6 @@
|
| config->xssAuditor->init(document(), &m_xssAuditorDelegate);
|
| config->preloadScanner = adoptPtr(new TokenPreloadScanner(document()->url().copy(), CachedDocumentParameters::create(document())));
|
| config->decoder = takeDecoder();
|
| - config->parsedChunkQueue = m_parsedChunkQueue.get();
|
| if (document()->settings()) {
|
| if (document()->settings()->backgroundHtmlParserOutstandingTokenLimit())
|
| config->outstandingTokenLimit = document()->settings()->backgroundHtmlParserOutstandingTokenLimit();
|
|
|