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..a4c8f197152d933c4cfcca8ccb96060894107228 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()); |
+ SegmentedString source(inputSource); |
kouhei (in TOK)
2014/12/18 04:34:36
Is it safe to reuse the SegmentedString for both p
kbalazs
2014/12/18 23:28:28
Both get's const reference argument so it should b
kouhei (in TOK)
2014/12/19 04:44:28
Thanks for clarification. Makes sense.
|
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. |