diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-05-16 09:59:13 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-05-20 10:28:53 +0000 |
commit | 6c11fb357ec39bf087b8b632e2b1e375aef1b38b (patch) | |
tree | c8315530db18a8ee566521c39ab8a6af4f72bc03 /chromium/third_party/blink/renderer/platform/wtf/text/text_codec.h | |
parent | 3ffaed019d0772e59d6cdb2d0d32fe4834c31f72 (diff) | |
download | qtwebengine-chromium-6c11fb357ec39bf087b8b632e2b1e375aef1b38b.tar.gz |
BASELINE: Update Chromium to 74.0.3729.159
Change-Id: I8d2497da544c275415aedd94dd25328d555de811
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/platform/wtf/text/text_codec.h')
-rw-r--r-- | chromium/third_party/blink/renderer/platform/wtf/text/text_codec.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/chromium/third_party/blink/renderer/platform/wtf/text/text_codec.h b/chromium/third_party/blink/renderer/platform/wtf/text/text_codec.h index d1316dda10d..5a9c4f69497 100644 --- a/chromium/third_party/blink/renderer/platform/wtf/text/text_codec.h +++ b/chromium/third_party/blink/renderer/platform/wtf/text/text_codec.h @@ -80,6 +80,11 @@ class WTF_EXPORT TextCodec { TextCodec() = default; virtual ~TextCodec(); + struct EncodeIntoResult { + wtf_size_t code_units_read; + wtf_size_t bytes_written; + }; + String Decode(const char* str, wtf_size_t length, FlushBehavior flush = FlushBehavior::kDoNotFlush) { @@ -98,6 +103,22 @@ class WTF_EXPORT TextCodec { virtual CString Encode(const LChar*, wtf_size_t length, UnencodableHandling) = 0; + // EncodeInto is meant only to encode UTF8 bytes into an unsigned char* + // buffer; therefore this method is only usefully overridden by TextCodecUTF8. + virtual EncodeIntoResult EncodeInto(const LChar*, + wtf_size_t length, + unsigned char* destination, + wtf_size_t capacity) { + NOTREACHED(); + return EncodeIntoResult{0, 0}; + } + virtual EncodeIntoResult EncodeInto(const UChar*, + wtf_size_t length, + unsigned char* destination, + wtf_size_t capacity) { + NOTREACHED(); + return EncodeIntoResult{0, 0}; + } // Fills a null-terminated string representation of the given // unencodable character into the given replacement buffer. |