summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/text/TextCodecUTF8.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/text/TextCodecUTF8.h')
-rw-r--r--Source/WebCore/platform/text/TextCodecUTF8.h19
1 files changed, 5 insertions, 14 deletions
diff --git a/Source/WebCore/platform/text/TextCodecUTF8.h b/Source/WebCore/platform/text/TextCodecUTF8.h
index 94305ce18..636a0cb8d 100644
--- a/Source/WebCore/platform/text/TextCodecUTF8.h
+++ b/Source/WebCore/platform/text/TextCodecUTF8.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,8 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef TextCodecUTF8_h
-#define TextCodecUTF8_h
+#pragma once
#include "TextCodec.h"
@@ -32,12 +31,6 @@ namespace WebCore {
class TextCodecUTF8 : public TextCodec {
public:
- static std::unique_ptr<TextCodec> create(const TextEncoding&, const void*);
- TextCodecUTF8()
- : m_partialSequenceSize(0)
- {
- }
-
static void registerEncodingNames(EncodingNameRegistrar);
static void registerCodecs(TextCodecRegistrar);
@@ -45,16 +38,14 @@ private:
virtual String decode(const char*, size_t length, bool flush, bool stopOnError, bool& sawError);
virtual CString encode(const UChar*, size_t length, UnencodableHandling);
- template <typename CharType>
- bool handlePartialSequence(CharType*& destination, const uint8_t*& source, const uint8_t* end, bool flush, bool stopOnError, bool& sawError);
- void handleError(UChar*& destination, bool stopOnError, bool& sawError);
+ bool handlePartialSequence(LChar*& destination, const uint8_t*& source, const uint8_t* end, bool flush);
+ void handlePartialSequence(UChar*& destination, const uint8_t*& source, const uint8_t* end, bool flush, bool stopOnError, bool& sawError);
void consumePartialSequenceByte();
- int m_partialSequenceSize;
+ int m_partialSequenceSize { 0 };
uint8_t m_partialSequence[U8_MAX_LENGTH];
};
} // namespace WebCore
-#endif // TextCodecUTF8_h