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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2c9811cad4281749824f4b7e0c1afed94d9b23b0..b8d0d23554c03b5d0b7027407b25255f60bc3014 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h
+++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h
@@ -183,7 +183,7 @@ private:
HTMLToken& token() { return *m_token; }
- HTMLParserOptions m_options;
+ HTMLParserOptions m_options {document()};
HTMLInputStream m_input;
OwnPtr<HTMLToken> m_token;
@@ -192,33 +192,34 @@ private:
Member<HTMLTreeBuilder> m_treeBuilder;
OwnPtr<HTMLPreloadScanner> m_preloadScanner;
OwnPtr<HTMLPreloadScanner> m_insertionPreloadScanner;
- OwnPtr<WebTaskRunner> m_loadingTaskRunner;
+ OwnPtr<WebTaskRunner> m_loadingTaskRunner = adoptPtr(document()->loadingTaskRunner()->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
Member<HTMLParserScheduler> m_parserScheduler;
HTMLSourceTracker m_sourceTracker;
TextPosition m_textPosition;
XSSAuditor m_xssAuditor;
- XSSAuditorDelegate m_xssAuditorDelegate;
+ XSSAuditorDelegate m_xssAuditorDelegate {document()};
// FIXME: m_lastChunkBeforeScript, m_tokenizer, m_token, and m_input should be combined into a single state object
// so they can be set and cleared together and passed between threads together.
OwnPtr<ParsedChunk> m_lastChunkBeforeScript;
Deque<OwnPtr<ParsedChunk>> m_speculations;
- WeakPtrFactory<HTMLDocumentParser> m_weakFactory;
WeakPtr<BackgroundHTMLParser> m_backgroundParser;
Member<HTMLResourcePreloader> m_preloader;
PreloadRequestStream m_queuedPreloads;
Vector<String> m_queuedDocumentWriteScripts;
RefPtr<ParsedChunkQueue> m_parsedChunkQueue;
- OwnPtr<DocumentWriteEvaluator> m_evaluator;
+ OwnPtr<DocumentWriteEvaluator> m_evaluator = DocumentWriteEvaluator::create(*document());
bool m_shouldUseThreading;
- bool m_endWasDelayed;
- bool m_haveBackgroundParser;
- bool m_tasksWereSuspended;
- unsigned m_pumpSessionNestingLevel;
- unsigned m_pumpSpeculationsSessionNestingLevel;
- bool m_isParsingAtLineNumber;
- bool m_triedLoadingLinkHeaders;
+ bool m_endWasDelayed = false;
+ bool m_haveBackgroundParser = false;
+ bool m_tasksWereSuspended = false;
+ unsigned m_pumpSessionNestingLevel = 0;
+ unsigned m_pumpSpeculationsSessionNestingLevel = 0;
+ bool m_isParsingAtLineNumber = false;
+ bool m_triedLoadingLinkHeaders = false;
+
+ WeakPtrFactory<HTMLDocumentParser> m_weakFactory {this};
};
} // namespace blink
« 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