| 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 cf5ea7ff0fa1726080d852e328860a78bf4e3f30..69f8d510dc4e3d0fa584237ed3c124a2acd1ed92 100644
|
| --- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
|
| +++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
|
| @@ -312,7 +312,7 @@ void HTMLDocumentParser::notifyPendingParsedChunks()
|
| } 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().
|
| + // after the document element is created in documentElementAvailable().
|
| ASSERT(m_queuedPreloads.isEmpty());
|
| ASSERT(m_queuedDocumentWriteScripts.isEmpty());
|
| for (auto& chunk : pendingChunks) {
|
| @@ -454,8 +454,6 @@ size_t HTMLDocumentParser::processParsedChunkFromBackgroundParser(PassOwnPtr<Par
|
| if (isStopped())
|
| break;
|
|
|
| - pumpPreloadQueue();
|
| -
|
| if (!m_triedLoadingLinkHeaders && document()->loader()) {
|
| String linkHeader = document()->loader()->response().httpHeaderField(HTTPNames::Link);
|
| if (!linkHeader.isEmpty()) {
|
| @@ -1055,11 +1053,10 @@ void HTMLDocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder)
|
| HTMLParserThread::shared()->postTask(threadSafeBind(&BackgroundHTMLParser::setDecoder, m_backgroundParser, passed(takeDecoder())));
|
| }
|
|
|
| -void HTMLDocumentParser::pumpPreloadQueue()
|
| +void HTMLDocumentParser::documentElementAvailable()
|
| {
|
| - if (!document()->documentElement())
|
| - return;
|
| -
|
| + TRACE_EVENT0("blink,loader", "HTMLDocumentParser::documentElementAvailable");
|
| + DCHECK(document()->documentElement());
|
| for (const String& scriptSource : m_queuedDocumentWriteScripts) {
|
| evaluateAndPreloadScriptForDocumentWrite(scriptSource);
|
| }
|
|
|