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

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

Issue 2041013004: HTMLDocumentParser: Dedupe member inits by moving them into in-class init (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 void pumpPreloadQueue(); 177 void pumpPreloadQueue();
178 178
179 PassOwnPtr<HTMLPreloadScanner> createPreloadScanner(); 179 PassOwnPtr<HTMLPreloadScanner> createPreloadScanner();
180 180
181 int preloadInsertion(const SegmentedString& source); 181 int preloadInsertion(const SegmentedString& source);
182 void evaluateAndPreloadScriptForDocumentWrite(const String& source); 182 void evaluateAndPreloadScriptForDocumentWrite(const String& source);
183 183
184 HTMLToken& token() { return *m_token; } 184 HTMLToken& token() { return *m_token; }
185 185
186 HTMLParserOptions m_options; 186 HTMLParserOptions m_options {document()};
187 HTMLInputStream m_input; 187 HTMLInputStream m_input;
188 188
189 OwnPtr<HTMLToken> m_token; 189 OwnPtr<HTMLToken> m_token;
190 OwnPtr<HTMLTokenizer> m_tokenizer; 190 OwnPtr<HTMLTokenizer> m_tokenizer;
191 Member<HTMLScriptRunner> m_scriptRunner; 191 Member<HTMLScriptRunner> m_scriptRunner;
192 Member<HTMLTreeBuilder> m_treeBuilder; 192 Member<HTMLTreeBuilder> m_treeBuilder;
193 OwnPtr<HTMLPreloadScanner> m_preloadScanner; 193 OwnPtr<HTMLPreloadScanner> m_preloadScanner;
194 OwnPtr<HTMLPreloadScanner> m_insertionPreloadScanner; 194 OwnPtr<HTMLPreloadScanner> m_insertionPreloadScanner;
195 OwnPtr<WebTaskRunner> m_loadingTaskRunner; 195 OwnPtr<WebTaskRunner> m_loadingTaskRunner = adoptPtr(document()->loadingTask Runner()->clone());
sof 2016/06/08 06:02:04 Is having non-const, dependent on field init order
kouhei (in TOK) 2016/06/08 06:07:17 The background is that we found m_isParsingAtLineN
sof 2016/06/08 06:40:24 Thanks for the context (and menu :) ), initializat
Yoav Weiss 2016/06/08 08:43:27 Just to make sure that I understand the problems s
196 Member<HTMLParserScheduler> m_parserScheduler; 196 Member<HTMLParserScheduler> m_parserScheduler;
197 HTMLSourceTracker m_sourceTracker; 197 HTMLSourceTracker m_sourceTracker;
198 TextPosition m_textPosition; 198 TextPosition m_textPosition;
199 XSSAuditor m_xssAuditor; 199 XSSAuditor m_xssAuditor;
200 XSSAuditorDelegate m_xssAuditorDelegate; 200 XSSAuditorDelegate m_xssAuditorDelegate {document()};
201 201
202 // FIXME: m_lastChunkBeforeScript, m_tokenizer, m_token, and m_input should be combined into a single state object 202 // FIXME: m_lastChunkBeforeScript, m_tokenizer, m_token, and m_input should be combined into a single state object
203 // so they can be set and cleared together and passed between threads togeth er. 203 // so they can be set and cleared together and passed between threads togeth er.
204 OwnPtr<ParsedChunk> m_lastChunkBeforeScript; 204 OwnPtr<ParsedChunk> m_lastChunkBeforeScript;
205 Deque<OwnPtr<ParsedChunk>> m_speculations; 205 Deque<OwnPtr<ParsedChunk>> m_speculations;
206 WeakPtrFactory<HTMLDocumentParser> m_weakFactory;
207 WeakPtr<BackgroundHTMLParser> m_backgroundParser; 206 WeakPtr<BackgroundHTMLParser> m_backgroundParser;
208 Member<HTMLResourcePreloader> m_preloader; 207 Member<HTMLResourcePreloader> m_preloader;
209 PreloadRequestStream m_queuedPreloads; 208 PreloadRequestStream m_queuedPreloads;
210 Vector<String> m_queuedDocumentWriteScripts; 209 Vector<String> m_queuedDocumentWriteScripts;
211 RefPtr<ParsedChunkQueue> m_parsedChunkQueue; 210 RefPtr<ParsedChunkQueue> m_parsedChunkQueue;
212 OwnPtr<DocumentWriteEvaluator> m_evaluator; 211 OwnPtr<DocumentWriteEvaluator> m_evaluator = DocumentWriteEvaluator::create( *document());
213 212
214 bool m_shouldUseThreading; 213 bool m_shouldUseThreading;
215 bool m_endWasDelayed; 214 bool m_endWasDelayed = false;
216 bool m_haveBackgroundParser; 215 bool m_haveBackgroundParser = false;
217 bool m_tasksWereSuspended; 216 bool m_tasksWereSuspended = false;
218 unsigned m_pumpSessionNestingLevel; 217 unsigned m_pumpSessionNestingLevel = 0;
219 unsigned m_pumpSpeculationsSessionNestingLevel; 218 unsigned m_pumpSpeculationsSessionNestingLevel = 0;
220 bool m_isParsingAtLineNumber; 219 bool m_isParsingAtLineNumber = false;
221 bool m_triedLoadingLinkHeaders; 220 bool m_triedLoadingLinkHeaders = false;
221
222 WeakPtrFactory<HTMLDocumentParser> m_weakFactory {this};
222 }; 223 };
223 224
224 } // namespace blink 225 } // namespace blink
225 226
226 #endif 227 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698