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

Unified Diff: sky/engine/core/html/parser/BackgroundHTMLParser.h

Issue 664573004: Live the dream (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: DEPS Created 6 years, 2 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: sky/engine/core/html/parser/BackgroundHTMLParser.h
diff --git a/sky/engine/core/html/parser/BackgroundHTMLParser.h b/sky/engine/core/html/parser/BackgroundHTMLParser.h
index 00073c2f0569d781123ce5b29dff4594f311057c..50c3cad8fd29a5d6326c05e7a48d5737753cd2b4 100644
--- a/sky/engine/core/html/parser/BackgroundHTMLParser.h
+++ b/sky/engine/core/html/parser/BackgroundHTMLParser.h
@@ -31,6 +31,8 @@
#include "core/html/parser/HTMLParserOptions.h"
#include "core/html/parser/HTMLTokenizer.h"
#include "core/html/parser/TextResourceDecoder.h"
+#include "mojo/public/cpp/system/core.h"
+#include "platform/fetcher/DataPipeDrainer.h"
#include "platform/text/SegmentedString.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/WeakPtr.h"
@@ -40,30 +42,31 @@ namespace blink {
class HTMLDocumentParser;
class SharedBuffer;
-class BackgroundHTMLParser {
+class BackgroundHTMLParser : public DataPipeDrainer::Client {
WTF_MAKE_FAST_ALLOCATED;
public:
struct Configuration {
HTMLParserOptions options;
+ mojo::ScopedDataPipeConsumerHandle source;
WeakPtr<HTMLDocumentParser> parser;
};
static base::WeakPtr<BackgroundHTMLParser> create(PassOwnPtr<Configuration>);
- void appendRawBytesFromMainThread(PassOwnPtr<Vector<char> >);
- void flush();
- void finish();
+ void start();
void stop();
private:
explicit BackgroundHTMLParser(PassOwnPtr<Configuration>);
~BackgroundHTMLParser();
- void appendDecodedBytes(const String&);
+ void OnDataAvailable(const void* data, size_t numberOfBytes) override;
+ void OnDataComplete() override;
+
+ void finish();
void markEndOfFile();
void pumpTokenizer();
void sendTokensToMainThread();
- void updateDocument(const String& decodedData);
bool updateTokenizerState(const CompactHTMLToken& token);
SegmentedString m_input;
@@ -74,6 +77,9 @@ private:
OwnPtr<CompactHTMLTokenStream> m_pendingTokens;
OwnPtr<TextResourceDecoder> m_decoder;
+ mojo::ScopedDataPipeConsumerHandle m_source;
+ OwnPtr<DataPipeDrainer> m_drainer;
+
base::WeakPtrFactory<BackgroundHTMLParser> m_weakFactory;
};
« no previous file with comments | « sky/engine/core/html/imports/HTMLImportLoader.cpp ('k') | sky/engine/core/html/parser/BackgroundHTMLParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698