diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-05-20 09:47:09 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-06-07 11:15:42 +0000 |
commit | 189d4fd8fad9e3c776873be51938cd31a42b6177 (patch) | |
tree | 6497caeff5e383937996768766ab3bb2081a40b2 /chromium/third_party/blink/renderer/core/html/parser/html_document_parser.h | |
parent | 8bc75099d364490b22f43a7ce366b366c08f4164 (diff) | |
download | qtwebengine-chromium-189d4fd8fad9e3c776873be51938cd31a42b6177.tar.gz |
BASELINE: Update Chromium to 90.0.4430.221
Change-Id: Iff4d9d18d2fcf1a576f3b1f453010f744a232920
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/html/parser/html_document_parser.h')
-rw-r--r-- | chromium/third_party/blink/renderer/core/html/parser/html_document_parser.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/chromium/third_party/blink/renderer/core/html/parser/html_document_parser.h b/chromium/third_party/blink/renderer/core/html/parser/html_document_parser.h index cac43e4b796..97ebb884b7f 100644 --- a/chromium/third_party/blink/renderer/core/html/parser/html_document_parser.h +++ b/chromium/third_party/blink/renderer/core/html/parser/html_document_parser.h @@ -67,6 +67,13 @@ class HTMLResourcePreloader; class HTMLTreeBuilder; class HTMLDocumentParserState; +enum ParserPrefetchPolicy { + // Indicates that prefetches/preloads should happen for this document type. + kAllowPrefetching, + // Indicates that prefetches are forbidden for this document type. + kDisallowPrefetching +}; + // TODO(https://crbug.com/1049898): These are only exposed to make it possible // to delete an expired histogram. The test should be rewritten to test at a // different level, so it won't have to make assertions about internal state. @@ -78,10 +85,13 @@ class CORE_EXPORT HTMLDocumentParser : public ScriptableDocumentParser, USING_PRE_FINALIZER(HTMLDocumentParser, Dispose); public: - HTMLDocumentParser(HTMLDocument&, ParserSynchronizationPolicy); + HTMLDocumentParser(HTMLDocument&, + ParserSynchronizationPolicy, + ParserPrefetchPolicy prefetch_policy = kAllowPrefetching); HTMLDocumentParser(DocumentFragment*, Element* context_element, - ParserContentPolicy); + ParserContentPolicy, + ParserPrefetchPolicy prefetch_policy = kAllowPrefetching); ~HTMLDocumentParser() override; void Trace(Visitor*) const override; @@ -156,7 +166,10 @@ class CORE_EXPORT HTMLDocumentParser : public ScriptableDocumentParser, private: HTMLDocumentParser(Document&, ParserContentPolicy, - ParserSynchronizationPolicy); + ParserSynchronizationPolicy, + ParserPrefetchPolicy); + + enum NextTokenStatus { NoTokens, HaveTokens, HaveTokensAfterScript }; // DocumentParser void Detach() final; @@ -194,7 +207,7 @@ class CORE_EXPORT HTMLDocumentParser : public ScriptableDocumentParser, bool*); void PumpPendingSpeculations(); - bool CanTakeNextToken(); + NextTokenStatus CanTakeNextToken(); bool PumpTokenizer(); void PumpTokenizerIfPossible(); void DeferredPumpTokenizerIfPossible(); @@ -228,7 +241,7 @@ class CORE_EXPORT HTMLDocumentParser : public ScriptableDocumentParser, std::unique_ptr<HTMLPreloadScanner> CreatePreloadScanner( TokenPreloadScanner::ScannerType); - // Let the given HTMLPreloadScanner scan the input it has, and then preloads + // Let the given HTMLPreloadScanner scan the input it has, and then preload // resources using the resulting PreloadRequests and |preloader_|. void ScanAndPreload(HTMLPreloadScanner*); void FetchQueuedPreloads(); |