| 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
|
|
|