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

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

Issue 2200613002: The HTML parser synchronously creates custom elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Eliminate redundant TODOs. 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 17 matching lines...) Expand all
28 28
29 #include "bindings/core/v8/DocumentWriteEvaluator.h" 29 #include "bindings/core/v8/DocumentWriteEvaluator.h"
30 #include "core/dom/ParserContentPolicy.h" 30 #include "core/dom/ParserContentPolicy.h"
31 #include "core/dom/ScriptableDocumentParser.h" 31 #include "core/dom/ScriptableDocumentParser.h"
32 #include "core/fetch/ResourceClient.h" 32 #include "core/fetch/ResourceClient.h"
33 #include "core/frame/UseCounter.h" 33 #include "core/frame/UseCounter.h"
34 #include "core/html/parser/BackgroundHTMLInputStream.h" 34 #include "core/html/parser/BackgroundHTMLInputStream.h"
35 #include "core/html/parser/CompactHTMLToken.h" 35 #include "core/html/parser/CompactHTMLToken.h"
36 #include "core/html/parser/HTMLInputStream.h" 36 #include "core/html/parser/HTMLInputStream.h"
37 #include "core/html/parser/HTMLParserOptions.h" 37 #include "core/html/parser/HTMLParserOptions.h"
38 #include "core/html/parser/HTMLParserReentryPermit.h"
38 #include "core/html/parser/HTMLPreloadScanner.h" 39 #include "core/html/parser/HTMLPreloadScanner.h"
39 #include "core/html/parser/HTMLScriptRunnerHost.h" 40 #include "core/html/parser/HTMLScriptRunnerHost.h"
40 #include "core/html/parser/HTMLSourceTracker.h" 41 #include "core/html/parser/HTMLSourceTracker.h"
41 #include "core/html/parser/HTMLToken.h" 42 #include "core/html/parser/HTMLToken.h"
42 #include "core/html/parser/HTMLTokenizer.h" 43 #include "core/html/parser/HTMLTokenizer.h"
43 #include "core/html/parser/HTMLTreeBuilderSimulator.h" 44 #include "core/html/parser/HTMLTreeBuilderSimulator.h"
44 #include "core/html/parser/ParserSynchronizationPolicy.h" 45 #include "core/html/parser/ParserSynchronizationPolicy.h"
45 #include "core/html/parser/TextResourceDecoder.h" 46 #include "core/html/parser/TextResourceDecoder.h"
46 #include "core/html/parser/XSSAuditor.h" 47 #include "core/html/parser/XSSAuditor.h"
47 #include "core/html/parser/XSSAuditorDelegate.h" 48 #include "core/html/parser/XSSAuditorDelegate.h"
48 #include "platform/text/SegmentedString.h" 49 #include "platform/text/SegmentedString.h"
49 #include "wtf/Deque.h" 50 #include "wtf/Deque.h"
51 #include "wtf/RefPtr.h"
50 #include "wtf/WeakPtr.h" 52 #include "wtf/WeakPtr.h"
51 #include "wtf/text/TextPosition.h" 53 #include "wtf/text/TextPosition.h"
52 #include <memory> 54 #include <memory>
53 55
54 namespace blink { 56 namespace blink {
55 57
56 class BackgroundHTMLParser; 58 class BackgroundHTMLParser;
57 class CompactHTMLToken; 59 class CompactHTMLToken;
58 class Document; 60 class Document;
59 class DocumentEncodingData; 61 class DocumentEncodingData;
(...skipping 28 matching lines...) Expand all
88 90
89 HTMLTokenizer* tokenizer() const { return m_tokenizer.get(); } 91 HTMLTokenizer* tokenizer() const { return m_tokenizer.get(); }
90 92
91 TextPosition textPosition() const final; 93 TextPosition textPosition() const final;
92 bool isParsingAtLineNumber() const final; 94 bool isParsingAtLineNumber() const final;
93 OrdinalNumber lineNumber() const final; 95 OrdinalNumber lineNumber() const final;
94 96
95 void suspendScheduledTasks() final; 97 void suspendScheduledTasks() final;
96 void resumeScheduledTasks() final; 98 void resumeScheduledTasks() final;
97 99
100 HTMLParserReentryPermit* reentryPermit() { return m_reentryPermit.get(); }
101
98 struct TokenizedChunk { 102 struct TokenizedChunk {
99 USING_FAST_MALLOC(TokenizedChunk); 103 USING_FAST_MALLOC(TokenizedChunk);
100 public: 104 public:
101 std::unique_ptr<CompactHTMLTokenStream> tokens; 105 std::unique_ptr<CompactHTMLTokenStream> tokens;
102 PreloadRequestStream preloads; 106 PreloadRequestStream preloads;
103 ViewportDescriptionWrapper viewport; 107 ViewportDescriptionWrapper viewport;
104 XSSInfoStream xssInfos; 108 XSSInfoStream xssInfos;
105 HTMLTokenizer::State tokenizerState; 109 HTMLTokenizer::State tokenizerState;
106 HTMLTreeBuilderSimulator::State treeBuilderState; 110 HTMLTreeBuilderSimulator::State treeBuilderState;
107 HTMLInputCheckpoint inputCheckpoint; 111 HTMLInputCheckpoint inputCheckpoint;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // with the given parameters. Note, this method is completely temporary 201 // with the given parameters. Note, this method is completely temporary
198 // as we need to maintain both threading implementations until the 202 // as we need to maintain both threading implementations until the
199 // ParseHTMLOnMainThread experiment finishes. 203 // ParseHTMLOnMainThread experiment finishes.
200 template <typename FunctionType, typename... Ps> 204 template <typename FunctionType, typename... Ps>
201 void postTaskToLookaheadParser(LookaheadParserTaskSynchrony synchronyPolicy, FunctionType, Ps&&... parameters); 205 void postTaskToLookaheadParser(LookaheadParserTaskSynchrony synchronyPolicy, FunctionType, Ps&&... parameters);
202 206
203 HTMLToken& token() { return *m_token; } 207 HTMLToken& token() { return *m_token; }
204 208
205 HTMLParserOptions m_options; 209 HTMLParserOptions m_options;
206 HTMLInputStream m_input; 210 HTMLInputStream m_input;
211 RefPtr<HTMLParserReentryPermit> m_reentryPermit;
207 212
208 std::unique_ptr<HTMLToken> m_token; 213 std::unique_ptr<HTMLToken> m_token;
209 std::unique_ptr<HTMLTokenizer> m_tokenizer; 214 std::unique_ptr<HTMLTokenizer> m_tokenizer;
210 Member<HTMLScriptRunner> m_scriptRunner; 215 Member<HTMLScriptRunner> m_scriptRunner;
211 Member<HTMLTreeBuilder> m_treeBuilder; 216 Member<HTMLTreeBuilder> m_treeBuilder;
212 std::unique_ptr<HTMLPreloadScanner> m_preloadScanner; 217 std::unique_ptr<HTMLPreloadScanner> m_preloadScanner;
213 std::unique_ptr<HTMLPreloadScanner> m_insertionPreloadScanner; 218 std::unique_ptr<HTMLPreloadScanner> m_insertionPreloadScanner;
214 std::unique_ptr<WebTaskRunner> m_loadingTaskRunner; 219 std::unique_ptr<WebTaskRunner> m_loadingTaskRunner;
215 Member<HTMLParserScheduler> m_parserScheduler; 220 Member<HTMLParserScheduler> m_parserScheduler;
216 HTMLSourceTracker m_sourceTracker; 221 HTMLSourceTracker m_sourceTracker;
(...skipping 19 matching lines...) Expand all
236 bool m_tasksWereSuspended; 241 bool m_tasksWereSuspended;
237 unsigned m_pumpSessionNestingLevel; 242 unsigned m_pumpSessionNestingLevel;
238 unsigned m_pumpSpeculationsSessionNestingLevel; 243 unsigned m_pumpSpeculationsSessionNestingLevel;
239 bool m_isParsingAtLineNumber; 244 bool m_isParsingAtLineNumber;
240 bool m_triedLoadingLinkHeaders; 245 bool m_triedLoadingLinkHeaders;
241 }; 246 };
242 247
243 } // namespace blink 248 } // namespace blink
244 249
245 #endif 250 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698