Chromium Code Reviews| 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..bb116db8e23d54e4073fe17fdf0d0f686fcaae34 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 && document()->loader()) { |
| + ViewportDescription oldDescription; |
|
sof
2016/03/18 20:03:42
unused?
Yoav Weiss
2016/03/18 22:02:49
yup, now gone
|
| + String linkHeader = document()->loader()->response().httpHeaderField(HTTPNames::Link); |
| + if (!linkHeader.isEmpty()) { |
| + ASSERT(chunk); |
| + LinkLoader::loadLinksFromHeader(linkHeader, document()->loader()->response().url(), |
| + document(), NetworkHintsInterfaceImpl(), LinkLoader::OnlyLoadResources, &(chunk->viewport)); |
| + m_isLoadedLinkHeaders = true; |
|
Nate Chapin
2016/03/18 19:28:01
I have trouble parsing m_isLoadedLinkHeaders. Mayb
Yoav Weiss
2016/03/18 22:02:49
renamed
|
| + } |
| + } |
| + |
| 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) |