Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2007, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com> | 3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com> |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 bool& saw_error) override; | 58 bool& saw_error) override; |
| 59 CString Encode(const UChar*, size_t length, UnencodableHandling) override; | 59 CString Encode(const UChar*, size_t length, UnencodableHandling) override; |
| 60 CString Encode(const LChar*, size_t length, UnencodableHandling) override; | 60 CString Encode(const LChar*, size_t length, UnencodableHandling) override; |
| 61 | 61 |
| 62 template <typename CharType> | 62 template <typename CharType> |
| 63 CString EncodeCommon(const CharType*, size_t length, UnencodableHandling); | 63 CString EncodeCommon(const CharType*, size_t length, UnencodableHandling); |
| 64 CString EncodeInternal(const TextCodecInput&, UnencodableHandling); | 64 CString EncodeInternal(const TextCodecInput&, UnencodableHandling); |
| 65 | 65 |
| 66 void CreateICUConverter() const; | 66 void CreateICUConverter() const; |
| 67 void ReleaseICUConverter() const; | 67 void ReleaseICUConverter() const; |
| 68 #if defined(USING_SYSTEM_ICU) | |
| 69 bool needsGBKFallbacks() const { return m_needsGBKFallbacks; } | |
| 70 void setNeedsGBKFallbacks(bool needsFallbacks) { | |
| 71 m_needsGBKFallbacks = needsFallbacks; | |
| 72 } | |
| 73 #endif | |
|
Nico
2017/05/10 18:14:01
Nothing calls these.
| |
| 74 | 68 |
| 75 int DecodeToBuffer(UChar* buffer, | 69 int DecodeToBuffer(UChar* buffer, |
| 76 UChar* buffer_limit, | 70 UChar* buffer_limit, |
| 77 const char*& source, | 71 const char*& source, |
| 78 const char* source_limit, | 72 const char* source_limit, |
| 79 int32_t* offsets, | 73 int32_t* offsets, |
| 80 bool flush, | 74 bool flush, |
| 81 UErrorCode&); | 75 UErrorCode&); |
| 82 | 76 |
| 83 TextEncoding encoding_; | 77 TextEncoding encoding_; |
| 84 mutable UConverter* converter_icu_; | 78 mutable UConverter* converter_icu_ = nullptr; |
| 85 #if defined(USING_SYSTEM_ICU) | 79 #if defined(USING_SYSTEM_ICU) |
| 86 mutable bool m_needsGBKFallbacks; | 80 mutable bool needs_gbk_fallbacks_ = false; |
| 87 #endif | 81 #endif |
| 88 | 82 |
| 89 FRIEND_TEST_ALL_PREFIXES(TextCodecICUTest, IgnorableCodePoint); | 83 FRIEND_TEST_ALL_PREFIXES(TextCodecICUTest, IgnorableCodePoint); |
| 90 FRIEND_TEST_ALL_PREFIXES(TextCodecICUTest, UTF32AndQuestionMarks); | 84 FRIEND_TEST_ALL_PREFIXES(TextCodecICUTest, UTF32AndQuestionMarks); |
| 91 FRIEND_TEST_ALL_PREFIXES(TextCodecICUTest, UTF32Aliases); | 85 FRIEND_TEST_ALL_PREFIXES(TextCodecICUTest, UTF32Aliases); |
| 92 }; | 86 }; |
| 93 | 87 |
| 94 struct ICUConverterWrapper { | 88 struct ICUConverterWrapper { |
| 95 WTF_MAKE_NONCOPYABLE(ICUConverterWrapper); | 89 WTF_MAKE_NONCOPYABLE(ICUConverterWrapper); |
| 96 USING_FAST_MALLOC(ICUConverterWrapper); | 90 USING_FAST_MALLOC(ICUConverterWrapper); |
| 97 | 91 |
| 98 public: | 92 public: |
| 99 ICUConverterWrapper() : converter(0) {} | 93 ICUConverterWrapper() : converter(0) {} |
| 100 ~ICUConverterWrapper(); | 94 ~ICUConverterWrapper(); |
| 101 | 95 |
| 102 UConverter* converter; | 96 UConverter* converter; |
| 103 }; | 97 }; |
| 104 | 98 |
| 105 } // namespace WTF | 99 } // namespace WTF |
| 106 | 100 |
| 107 #endif // TextCodecICU_h | 101 #endif // TextCodecICU_h |
| OLD | NEW |