| Index: third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h
|
| diff --git a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h
|
| index 84a12b1b2b83237923cff750cd9b0edfbdbaec63..c87afadebf42c4d8a19885e131bc393cb1c003a4 100644
|
| --- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h
|
| +++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h
|
| @@ -48,6 +48,7 @@
|
| #include "core/html/parser/XSSAuditorDelegate.h"
|
| #include "platform/text/SegmentedString.h"
|
| #include "wtf/Deque.h"
|
| +#include "wtf/Optional.h"
|
| #include "wtf/RefPtr.h"
|
| #include "wtf/WeakPtr.h"
|
| #include "wtf/text/TextPosition.h"
|
| @@ -113,6 +114,9 @@ public:
|
| bool startingScript;
|
| // Indices into |tokens|.
|
| Vector<int> likelyDocumentWriteScriptIndices;
|
| + // Index into |tokens| of the last <meta> csp tag in |tokens|. Preloads
|
| + // will be deferred until this token is parsed.
|
| + WTF::Optional<int> pendingCSPMetaTokenIndex;
|
| };
|
| void notifyPendingTokenizedChunks();
|
| void didReceiveEncodingDataFromBackgroundParser(const DocumentEncodingData&);
|
| @@ -186,7 +190,8 @@ private:
|
|
|
| std::unique_ptr<HTMLPreloadScanner> createPreloadScanner();
|
|
|
| - int preloadInsertion(const SegmentedString& source);
|
| + void fetchQueuedPreloads();
|
| +
|
| void evaluateAndPreloadScriptForDocumentWrite(const String& source);
|
|
|
| // Temporary enum for the ParseHTMLOnMainThread experiment. This is used to
|
| @@ -235,6 +240,15 @@ private:
|
| RefPtr<TokenizedChunkQueue> m_tokenizedChunkQueue;
|
| std::unique_ptr<DocumentWriteEvaluator> m_evaluator;
|
|
|
| + // If this is non-null, then there is a meta CSP token somewhere in the
|
| + // speculation buffer. Preloads will be deferred until a token matching this
|
| + // pointer is parsed and the CSP policy is applied. Note that this pointer
|
| + // tracks the *last* meta token in the speculation buffer, so it
|
| + // overestimates how long to defer preloads. This is for simplicity, as the
|
| + // alternative would require keeping track of token positions of preload
|
| + // requests.
|
| + CompactHTMLToken* m_pendingCSPMetaToken;
|
| +
|
| bool m_shouldUseThreading;
|
| bool m_endWasDelayed;
|
| bool m_haveBackgroundParser;
|
|
|