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

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

Issue 100563004: Redirect HTML resource bytes directly to parser thread (Blink side CL) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@parserthread_decodermove
Patch Set: Created 6 years, 10 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
Index: Source/core/html/parser/BackgroundHTMLParser.cpp
diff --git a/Source/core/html/parser/BackgroundHTMLParser.cpp b/Source/core/html/parser/BackgroundHTMLParser.cpp
index 77d11543259836602909d8da77ebeed03c3d073e..e169e6d2f2ac2ab5a026f29a2c0ebed942e2b704 100644
--- a/Source/core/html/parser/BackgroundHTMLParser.cpp
+++ b/Source/core/html/parser/BackgroundHTMLParser.cpp
@@ -27,7 +27,6 @@
#include "core/html/parser/BackgroundHTMLParser.h"
#include "core/html/parser/HTMLDocumentParser.h"
-#include "core/html/parser/HTMLParserThread.h"
#include "core/html/parser/TextResourceDecoder.h"
#include "core/html/parser/XSSAuditor.h"
#include "wtf/MainThread.h"
@@ -101,6 +100,12 @@ BackgroundHTMLParser::~BackgroundHTMLParser()
{
}
+void BackgroundHTMLParser::acceptData(const char* data, int dataLength)
+{
+ ASSERT(m_decoder);
+ updateDocument(m_decoder->decode(data, dataLength));
+}
+
void BackgroundHTMLParser::append(const String& input)
{
ASSERT(!m_input.current().isClosed());
@@ -110,16 +115,19 @@ void BackgroundHTMLParser::append(const String& input)
void BackgroundHTMLParser::appendBytes(PassOwnPtr<Vector<char> > buffer)
{
+ ASSERT(m_decoder);
updateDocument(m_decoder->decode(buffer->data(), buffer->size()));
}
void BackgroundHTMLParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder)
{
+ ASSERT(decoder);
m_decoder = decoder;
}
void BackgroundHTMLParser::flush()
{
+ ASSERT(m_decoder);
updateDocument(m_decoder->flush());
}

Powered by Google App Engine
This is Rietveld 408576698