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

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

Issue 74513003: Moved text decoding to the parser thread (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@parserthread_step25
Patch Set: Created 7 years, 1 month 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.h
diff --git a/Source/core/html/parser/BackgroundHTMLParser.h b/Source/core/html/parser/BackgroundHTMLParser.h
index b9b5a511c49d5ef2ff926353764448aa7ffb06f4..1753d98be3870161fd1d5275964ca42990e916d1 100644
--- a/Source/core/html/parser/BackgroundHTMLParser.h
+++ b/Source/core/html/parser/BackgroundHTMLParser.h
@@ -31,8 +31,6 @@
#include "core/html/parser/HTMLParserOptions.h"
#include "core/html/parser/HTMLPreloadScanner.h"
#include "core/html/parser/HTMLSourceTracker.h"
-#include "core/html/parser/HTMLToken.h"
-#include "core/html/parser/HTMLTokenizer.h"
#include "core/html/parser/HTMLTreeBuilderSimulator.h"
#include "core/html/parser/XSSAuditorDelegate.h"
#include "wtf/PassOwnPtr.h"
@@ -41,6 +39,7 @@
namespace WebCore {
class HTMLDocumentParser;
+class SharedBuffer;
class XSSAuditor;
class BackgroundHTMLParser {
@@ -53,11 +52,7 @@ public:
OwnPtr<TokenPreloadScanner> preloadScanner;
};
- static void create(PassRefPtr<WeakReference<BackgroundHTMLParser> > reference, PassOwnPtr<Configuration> config)
- {
- new BackgroundHTMLParser(reference, config);
- // Caller must free by calling stop().
- }
+ static void create(PassRefPtr<WeakReference<BackgroundHTMLParser> >, PassOwnPtr<Configuration>, PassOwnPtr<TextResourceDecoder>);
abarth-chromium 2013/11/18 06:57:10 Why not put the TextResourceDecoder in the Configu
eseidel 2013/11/18 20:07:40 +1
struct Checkpoint {
WeakPtr<HTMLDocumentParser> parser;
@@ -70,6 +65,8 @@ public:
};
void append(const String&);
+ void appendBytes(PassRefPtr<SharedBuffer> data);
+ void flush();
void resumeFrom(PassOwnPtr<Checkpoint>);
void startedChunkWithCheckpoint(HTMLInputCheckpoint);
void finish();
@@ -78,11 +75,13 @@ public:
void forcePlaintextForTextDocument();
private:
- BackgroundHTMLParser(PassRefPtr<WeakReference<BackgroundHTMLParser> >, PassOwnPtr<Configuration>);
+ BackgroundHTMLParser(PassRefPtr<WeakReference<BackgroundHTMLParser> >, PassOwnPtr<Configuration>, PassOwnPtr<TextResourceDecoder>);
+ ~BackgroundHTMLParser();
void markEndOfFile();
void pumpTokenizer();
void sendTokensToMainThread();
+ void updateDocument(String& decodedData);
WeakPtrFactory<BackgroundHTMLParser> m_weakFactory;
BackgroundHTMLInputStream m_input;
@@ -99,6 +98,8 @@ private:
OwnPtr<XSSAuditor> m_xssAuditor;
OwnPtr<TokenPreloadScanner> m_preloadScanner;
+ OwnPtr<TextResourceDecoder> m_decoder;
+ DocumentEncodingData m_lastSeenEncodingData;
};
}

Powered by Google App Engine
This is Rietveld 408576698