Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h

Issue 2242223003: Preload tokens even if a <meta> csp tag is found (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less refactoring Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..97724a4a86a98bdd18af9328e13e2e2872b97031 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h
+++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h
@@ -113,6 +113,9 @@ public:
bool startingScript;
// Indices into |tokens|.
Vector<int> likelyDocumentWriteScriptIndices;
+ // Raw pointer into the last <meta> csp tag in |tokens|. Preloads will
+ // be deferred until this token is parsed.
+ CompactHTMLToken* pendingCSPMetaTag;
kouhei (in TOK) 2016/08/19 04:56:15 Let's use index as in "likelyDocumentWriteScriptIn
Charlie Harrison 2016/08/19 12:33:33 SGTM but we'll have to pull the pointer out when t
kouhei (in TOK) 2016/08/22 05:34:03 I'm thinking of keeping a defer counter on the mai
Charlie Harrison 2016/08/22 14:08:05 Do you mean a followup? I'd be happy to implement
kouhei (in TOK) 2016/08/23 02:18:39 I mean a follow up. I'm not sure if its really pos
};
void notifyPendingTokenizedChunks();
void didReceiveEncodingDataFromBackgroundParser(const DocumentEncodingData&);
@@ -186,7 +189,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 +239,8 @@ private:
RefPtr<TokenizedChunkQueue> m_tokenizedChunkQueue;
std::unique_ptr<DocumentWriteEvaluator> m_evaluator;
+ CompactHTMLToken* m_pendingCSPMetaTag;
+
bool m_shouldUseThreading;
bool m_endWasDelayed;
bool m_haveBackgroundParser;

Powered by Google App Engine
This is Rietveld 408576698