| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "wtf/text/TextCodec.h" | 5 #include "platform/wtf/text/TextCodec.h" |
| 6 | 6 |
| 7 #include "platform/testing/BlinkFuzzerTestSupport.h" | 7 #include "platform/testing/BlinkFuzzerTestSupport.h" |
| 8 #include "platform/testing/FuzzedDataProvider.h" | 8 #include "platform/testing/FuzzedDataProvider.h" |
| 9 #include "wtf/text/CString.h" | 9 #include "platform/wtf/text/CString.h" |
| 10 #include "wtf/text/TextEncoding.h" | 10 #include "platform/wtf/text/TextEncoding.h" |
| 11 #include "wtf/text/TextEncodingRegistry.h" | 11 #include "platform/wtf/text/TextEncodingRegistry.h" |
| 12 | 12 |
| 13 using namespace blink; | 13 using namespace blink; |
| 14 | 14 |
| 15 // TODO(jsbell): This fuzzes code in wtf/ but has dependencies on platform/, | 15 // TODO(jsbell): This fuzzes code in wtf/ but has dependencies on platform/, |
| 16 // so it must live in the latter directory. Once wtf/ moves into platform/wtf | 16 // so it must live in the latter directory. Once wtf/ moves into platform/wtf |
| 17 // this should move there as well. | 17 // this should move there as well. |
| 18 | 18 |
| 19 WTF::FlushBehavior kFlushBehavior[] = {WTF::kDoNotFlush, WTF::kFetchEOF, | 19 WTF::FlushBehavior kFlushBehavior[] = {WTF::kDoNotFlush, WTF::kFetchEOF, |
| 20 WTF::kDataEOF}; | 20 WTF::kDataEOF}; |
| 21 | 21 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 // Round trip the bytes (aka encode the decoded bytes). | 87 // Round trip the bytes (aka encode the decoded bytes). |
| 88 if (decoded.Is8Bit()) { | 88 if (decoded.Is8Bit()) { |
| 89 codec->Encode(decoded.Characters8(), decoded.length(), unencodableHandling); | 89 codec->Encode(decoded.Characters8(), decoded.length(), unencodableHandling); |
| 90 } else { | 90 } else { |
| 91 codec->Encode(decoded.Characters16(), decoded.length(), | 91 codec->Encode(decoded.Characters16(), decoded.length(), |
| 92 unencodableHandling); | 92 unencodableHandling); |
| 93 } | 93 } |
| 94 return 0; | 94 return 0; |
| 95 } | 95 } |
| OLD | NEW |