| Index: third_party/WebKit/Source/wtf/text/TextCodecReplacement.cpp
|
| diff --git a/third_party/WebKit/Source/wtf/text/TextCodecReplacement.cpp b/third_party/WebKit/Source/wtf/text/TextCodecReplacement.cpp
|
| index a3b399987b6968819de7cbd5414f79a5c628d228..ffaf51b0ce551b125f3c76e3031a50bb6e6f7149 100644
|
| --- a/third_party/WebKit/Source/wtf/text/TextCodecReplacement.cpp
|
| +++ b/third_party/WebKit/Source/wtf/text/TextCodecReplacement.cpp
|
| @@ -10,44 +10,44 @@
|
|
|
| namespace WTF {
|
|
|
| -TextCodecReplacement::TextCodecReplacement()
|
| - : m_sentEOF(false)
|
| -{
|
| +TextCodecReplacement::TextCodecReplacement() : m_sentEOF(false) {}
|
| +
|
| +void TextCodecReplacement::registerEncodingNames(
|
| + EncodingNameRegistrar registrar) {
|
| + // The 'replacement' label itself should not be referenceable by
|
| + // resources or script - it's a specification convenience - but much of
|
| + // the wtf/text API asserts that an encoding name is a label for itself.
|
| + // This is handled in TextEncoding by marking it as not valid.
|
| + registrar("replacement", "replacement");
|
| +
|
| + registrar("csiso2022kr", "replacement");
|
| + registrar("hz-gb-2312", "replacement");
|
| + registrar("iso-2022-cn", "replacement");
|
| + registrar("iso-2022-cn-ext", "replacement");
|
| + registrar("iso-2022-kr", "replacement");
|
| }
|
|
|
| -void TextCodecReplacement::registerEncodingNames(EncodingNameRegistrar registrar)
|
| -{
|
| - // The 'replacement' label itself should not be referenceable by
|
| - // resources or script - it's a specification convenience - but much of
|
| - // the wtf/text API asserts that an encoding name is a label for itself.
|
| - // This is handled in TextEncoding by marking it as not valid.
|
| - registrar("replacement", "replacement");
|
| -
|
| - registrar("csiso2022kr", "replacement");
|
| - registrar("hz-gb-2312", "replacement");
|
| - registrar("iso-2022-cn", "replacement");
|
| - registrar("iso-2022-cn-ext", "replacement");
|
| - registrar("iso-2022-kr", "replacement");
|
| +static PassOwnPtr<TextCodec> newStreamingTextDecoderReplacement(
|
| + const TextEncoding&,
|
| + const void*) {
|
| + return adoptPtr(new TextCodecReplacement);
|
| }
|
|
|
| -static PassOwnPtr<TextCodec> newStreamingTextDecoderReplacement(const TextEncoding&, const void*)
|
| -{
|
| - return adoptPtr(new TextCodecReplacement);
|
| +void TextCodecReplacement::registerCodecs(TextCodecRegistrar registrar) {
|
| + registrar("replacement", newStreamingTextDecoderReplacement, 0);
|
| }
|
|
|
| -void TextCodecReplacement::registerCodecs(TextCodecRegistrar registrar)
|
| -{
|
| - registrar("replacement", newStreamingTextDecoderReplacement, 0);
|
| +String TextCodecReplacement::decode(const char*,
|
| + size_t,
|
| + FlushBehavior,
|
| + bool,
|
| + bool& sawError) {
|
| + sawError = true;
|
| + if (m_sentEOF)
|
| + return String();
|
| +
|
| + m_sentEOF = true;
|
| + return String(&replacementCharacter, 1);
|
| }
|
|
|
| -String TextCodecReplacement::decode(const char*, size_t, FlushBehavior, bool, bool& sawError)
|
| -{
|
| - sawError = true;
|
| - if (m_sentEOF)
|
| - return String();
|
| -
|
| - m_sentEOF = true;
|
| - return String(&replacementCharacter, 1);
|
| -}
|
| -
|
| -} // namespace WTF
|
| +} // namespace WTF
|
|
|