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

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

Issue 799803004: Demistify DocumentParser::append (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: resurrect fixme Created 6 years 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 075d613a8b6d51d425c114b816eae84798f118f3..9f9c44dbbffa480ec5f94314793f8f0bfcdf0140 100644
--- a/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -755,7 +755,7 @@ void HTMLDocumentParser::stopBackgroundParser()
m_weakFactory.revokeAll();
}
-void HTMLDocumentParser::append(PassRefPtr<StringImpl> inputSource)
+void HTMLDocumentParser::append(const String& inputSource)
{
if (isStopped())
return;
@@ -767,8 +767,8 @@ void HTMLDocumentParser::append(PassRefPtr<StringImpl> inputSource)
// pumpTokenizer can cause this parser to be detached from the Document,
// but we need to ensure it isn't deleted yet.
RefPtrWillBeRawPtr<HTMLDocumentParser> protect(this);
- TRACE_EVENT1("net", "HTMLDocumentParser::append", "size", inputSource->length());
- String source(inputSource);
+ TRACE_EVENT1("net", "HTMLDocumentParser::append", "size", inputSource.length());
+ const SegmentedString source(inputSource);
if (m_preloadScanner) {
if (m_input.current().isEmpty() && !isWaitingForScripts()) {
@@ -1006,7 +1006,7 @@ void HTMLDocumentParser::executeScriptsWaitingForResources()
void HTMLDocumentParser::parseDocumentFragment(const String& source, DocumentFragment* fragment, Element* contextElement, ParserContentPolicy parserContentPolicy)
{
RefPtrWillBeRawPtr<HTMLDocumentParser> parser = HTMLDocumentParser::create(fragment, contextElement, parserContentPolicy);
- parser->append(source.impl());
+ parser->append(source);
parser->finish();
ASSERT(!parser->processingData()); // Make sure we're done. <rdar://problem/3963151>
parser->detach(); // Allows ~DocumentParser to assert it was detached before destruction.
« 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