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

Unified Diff: Source/core/dom/DecodedDataDocumentParser.h

Issue 69823002: Move ownership of the TextResourceDecoder to DecodedDataDocumentParser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review fixes 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/DecodedDataDocumentParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DecodedDataDocumentParser.h
diff --git a/Source/core/dom/DecodedDataDocumentParser.h b/Source/core/dom/DecodedDataDocumentParser.h
index c931c0c7402711ffce1a7a3af0cd39174986a827..c237175c2c38277e11f5fe7f5b8b291de1e514f8 100644
--- a/Source/core/dom/DecodedDataDocumentParser.h
+++ b/Source/core/dom/DecodedDataDocumentParser.h
@@ -27,8 +27,10 @@
#define DecodedDataDocumentParser_h
#include "core/dom/DocumentParser.h"
+#include "wtf/RefPtr.h"
namespace WebCore {
+class TextResourceDecoder;
class DecodedDataDocumentParser : public DocumentParser {
public:
@@ -36,17 +38,24 @@ public:
// XMLHttpRequest if the responseXML was well formed.
virtual bool wellFormed() const { return true; }
+ // The below functions are used by DocumentWriter (the loader).
+ virtual size_t appendBytes(const char* bytes, size_t length) OVERRIDE;
+ virtual size_t flush() OVERRIDE;
+ virtual bool needsDecoder() const OVERRIDE { return !m_decoder; }
+ virtual void setDecoder(PassRefPtr<TextResourceDecoder>) OVERRIDE;
+ virtual PassRefPtr<TextResourceDecoder> decoder() OVERRIDE;
+
protected:
explicit DecodedDataDocumentParser(Document*);
+ virtual ~DecodedDataDocumentParser();
private:
// append is used by DocumentWriter::replaceDocument.
virtual void append(PassRefPtr<StringImpl>) = 0;
- // appendBytes and flush are used by DocumentWriter (the loader).
- virtual size_t appendBytes(const char* bytes, size_t length) OVERRIDE;
- virtual size_t flush() OVERRIDE;
- virtual bool needsDecoder() const OVERRIDE { return true; }
+ void updateDocumentEncoding();
+
+ RefPtr<TextResourceDecoder> m_decoder;
};
}
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/DecodedDataDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698