| 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 0ed9b645e97913e65ae42861cfb2848a1a67024c..5a78921495c1eb567ccb38defa7cf32ac889d0f0 100644
|
| --- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
|
| +++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
|
| @@ -43,6 +43,7 @@
|
| #include "core/inspector/InspectorInstrumentation.h"
|
| #include "core/inspector/InspectorTraceEvents.h"
|
| #include "core/loader/DocumentLoader.h"
|
| +#include "core/loader/LinkLoader.h"
|
| #include "core/loader/NavigationScheduler.h"
|
| #include "platform/SharedBuffer.h"
|
| #include "platform/ThreadSafeFunctional.h"
|
| @@ -127,6 +128,7 @@ HTMLDocumentParser::HTMLDocumentParser(HTMLDocument& document, bool reportErrors
|
| , m_pumpSessionNestingLevel(0)
|
| , m_pumpSpeculationsSessionNestingLevel(0)
|
| , m_isParsingAtLineNumber(false)
|
| + , m_isLoadedLinkHeaders(false)
|
| {
|
| ASSERT(shouldUseThreading() || (m_token && m_tokenizer));
|
| }
|
| @@ -490,6 +492,17 @@ size_t HTMLDocumentParser::processParsedChunkFromBackgroundParser(PassOwnPtr<Par
|
| if (!m_queuedPreloads.isEmpty() && document()->documentElement())
|
| m_preloader->takeAndPreload(m_queuedPreloads);
|
|
|
| + if (!m_isLoadedLinkHeaders) {
|
| + ViewportDescription oldDescription;
|
| + String linkHeader = document()->loader()->response().httpHeaderField(HTTPNames::Link);
|
| + if (!linkHeader.isEmpty()) {
|
| + ASSERT(chunk);
|
| + LinkLoader::loadLinkFromHeader(linkHeader, document()->loader()->response().url(),
|
| + document(), NetworkHintsInterfaceImpl(), LinkLoader::OnlyLoadResources, &(chunk->viewport));
|
| + m_isLoadedLinkHeaders = true;
|
| + }
|
| + }
|
| +
|
| if (isWaitingForScripts()) {
|
| ASSERT(it + 1 == tokens->end()); // The </script> is assumed to be the last token of this bunch.
|
| runScriptsForPausedTreeBuilder();
|
| @@ -664,7 +677,7 @@ void HTMLDocumentParser::pumpTokenizer()
|
| MediaValuesCached::MediaValuesCachedData(*document()));
|
| m_preloadScanner->appendToEnd(m_input.current());
|
| }
|
| - m_preloadScanner->scan(m_preloader.get(), document()->baseElementURL());
|
| + m_preloadScanner->scan(m_preloader.get(), document()->baseElementURL(), nullptr);
|
| }
|
| }
|
|
|
| @@ -751,7 +764,7 @@ void HTMLDocumentParser::insert(const SegmentedString& source)
|
| }
|
|
|
| m_insertionPreloadScanner->appendToEnd(source);
|
| - m_insertionPreloadScanner->scan(m_preloader.get(), document()->baseElementURL());
|
| + m_insertionPreloadScanner->scan(m_preloader.get(), document()->baseElementURL(), nullptr);
|
| }
|
|
|
| endIfDelayed();
|
| @@ -831,7 +844,7 @@ void HTMLDocumentParser::append(const String& inputSource)
|
| } else {
|
| m_preloadScanner->appendToEnd(source);
|
| if (isWaitingForScripts())
|
| - m_preloadScanner->scan(m_preloader.get(), document()->baseElementURL());
|
| + m_preloadScanner->scan(m_preloader.get(), document()->baseElementURL(), nullptr);
|
| }
|
| }
|
|
|
| @@ -1011,7 +1024,7 @@ void HTMLDocumentParser::appendCurrentInputStreamToPreloadScannerAndScan()
|
| {
|
| ASSERT(m_preloadScanner);
|
| m_preloadScanner->appendToEnd(m_input.current());
|
| - m_preloadScanner->scan(m_preloader.get(), document()->baseElementURL());
|
| + m_preloadScanner->scan(m_preloader.get(), document()->baseElementURL(), nullptr);
|
| }
|
|
|
| void HTMLDocumentParser::notifyScriptLoaded(Resource* cachedResource)
|
|
|