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

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

Issue 74513003: Moved text decoding to the parser thread (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@parserthread_step25
Patch Set: DocumentEncodingData is now constructed from a decoder 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/dom/DocumentEncodingData.h
diff --git a/Source/core/dom/DocumentEncodingData.h b/Source/core/dom/DocumentEncodingData.h
index d41c078dc87c107f0e597746ead83e9d891aea55..2016aa531ae3fa5f8a856381cca6509e7b1e5269 100644
--- a/Source/core/dom/DocumentEncodingData.h
+++ b/Source/core/dom/DocumentEncodingData.h
@@ -31,20 +31,34 @@
#ifndef DocumentEncodingData_h
#define DocumentEncodingData_h
+#include "wtf/text/TextEncoding.h"
+
namespace WebCore {
+class TextResourceDecoder;
+
+class DocumentEncodingData {
+public:
+ DocumentEncodingData();
+ explicit DocumentEncodingData(const TextResourceDecoder&);
-struct DocumentEncodingData {
- DocumentEncodingData()
- : wasDetectedHeuristically(false)
- , sawDecodingError(false)
- {
- }
+ const WTF::TextEncoding& encoding() const { return m_encoding; }
+ void setEncoding(const WTF::TextEncoding&);
+ bool wasDetectedHeuristically() const { return m_wasDetectedHeuristically; }
+ bool sawDecodingError() const { return m_sawDecodingError; }
- WTF::TextEncoding encoding;
- bool wasDetectedHeuristically;
- bool sawDecodingError;
+private:
+ WTF::TextEncoding m_encoding;
+ bool m_wasDetectedHeuristically;
+ bool m_sawDecodingError;
};
+inline bool operator!=(const DocumentEncodingData& a, const DocumentEncodingData& b)
+{
+ return a.encoding() != b.encoding()
+ || a.wasDetectedHeuristically() != b.wasDetectedHeuristically()
+ || a.sawDecodingError() != b.sawDecodingError();
+}
+
} // namespace WebCore
#endif // DocumentEncodingData_h

Powered by Google App Engine
This is Rietveld 408576698