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

Unified Diff: Source/core/html/parser/HTMLDocumentParser.cpp

Issue 277633002: Convert DocumentParser code to Use more reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make TextDocument use reference as well Created 6 years, 7 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 | « Source/core/html/parser/HTMLDocumentParser.h ('k') | Source/core/html/parser/HTMLViewSourceParser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLDocumentParser.cpp
diff --git a/Source/core/html/parser/HTMLDocumentParser.cpp b/Source/core/html/parser/HTMLDocumentParser.cpp
index e6cf774d729dfddc4a31d296319336a5df384720..7d460b619ae898b046da8c38690985ed07476e8d 100644
--- a/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -99,18 +99,17 @@ private:
WeakPtr<BackgroundHTMLParser> m_backgroundParser;
};
-// FIXME: HTMLDocument should be a reference.
-HTMLDocumentParser::HTMLDocumentParser(HTMLDocument* document, bool reportErrors)
- : ScriptableDocumentParser(*document)
- , m_options(document)
+HTMLDocumentParser::HTMLDocumentParser(HTMLDocument& document, bool reportErrors)
+ : ScriptableDocumentParser(document)
+ , m_options(&document)
, m_token(m_options.useThreading ? nullptr : adoptPtr(new HTMLToken))
, m_tokenizer(m_options.useThreading ? nullptr : HTMLTokenizer::create(m_options))
- , m_scriptRunner(HTMLScriptRunner::create(document, this))
- , m_treeBuilder(HTMLTreeBuilder::create(this, document, parserContentPolicy(), reportErrors, m_options))
+ , m_scriptRunner(HTMLScriptRunner::create(&document, this))
+ , m_treeBuilder(HTMLTreeBuilder::create(this, &document, parserContentPolicy(), reportErrors, m_options))
, m_parserScheduler(HTMLParserScheduler::create(this))
- , m_xssAuditorDelegate(document)
+ , m_xssAuditorDelegate(&document)
, m_weakFactory(this)
- , m_preloader(adoptPtr(new HTMLResourcePreloader(document)))
+ , m_preloader(adoptPtr(new HTMLResourcePreloader(&document)))
, m_isPinnedToMainThread(false)
, m_endWasDelayed(false)
, m_haveBackgroundParser(false)
« no previous file with comments | « Source/core/html/parser/HTMLDocumentParser.h ('k') | Source/core/html/parser/HTMLViewSourceParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698