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

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

Issue 141143007: Revert of Revert "Moved text decoding to the parser thread" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 11 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
« no previous file with comments | « Source/core/dom/DocumentEncodingData.h ('k') | Source/core/dom/DocumentParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DocumentEncodingData.cpp
diff --git a/Source/core/html/HTMLImportResourceOwner.cpp b/Source/core/dom/DocumentEncodingData.cpp
similarity index 74%
copy from Source/core/html/HTMLImportResourceOwner.cpp
copy to Source/core/dom/DocumentEncodingData.cpp
index 3a3109c477d94ff1e52c7d3bc290d7f52fdd9337..23d69f5ceb49e174b6a98e31f5b00a8b8d6c9c2a 100644
--- a/Source/core/html/HTMLImportResourceOwner.cpp
+++ b/Source/core/dom/DocumentEncodingData.cpp
@@ -29,32 +29,28 @@
*/
#include "config.h"
-#include "core/html/HTMLImportResourceOwner.h"
+#include "core/dom/DocumentEncodingData.h"
-namespace WebCore {
+#include "core/html/parser/TextResourceDecoder.h"
-HTMLImportResourceOwner::HTMLImportResourceOwner()
-{
-}
+namespace WebCore {
-HTMLImportResourceOwner::~HTMLImportResourceOwner()
+DocumentEncodingData::DocumentEncodingData()
+ : m_wasDetectedHeuristically(false)
+ , m_sawDecodingError(false)
{
- clearResource();
}
-void HTMLImportResourceOwner::setResource(const ResourcePtr<RawResource>& resource)
+DocumentEncodingData::DocumentEncodingData(const TextResourceDecoder& decoder)
{
- ASSERT(!hasResource());
- m_resource = resource;
- m_resource->addClient(this);
+ m_encoding = decoder.encoding();
+ m_wasDetectedHeuristically = decoder.encodingWasDetectedHeuristically();
+ m_sawDecodingError = decoder.sawError();
}
-void HTMLImportResourceOwner::clearResource()
+void DocumentEncodingData::setEncoding(const WTF::TextEncoding& encoding)
{
- if (!hasResource())
- return;
- m_resource->removeClient(this);
- m_resource = 0;
+ m_encoding = encoding;
}
} // namespace WebCore
« no previous file with comments | « Source/core/dom/DocumentEncodingData.h ('k') | Source/core/dom/DocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698