Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1812)

Unified Diff: Source/modules/encoding/TextDecoder.cpp

Issue 23532016: Handle odd data lengths in UTF-16 decoder (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Simplify Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/parser/TextResourceDecoder.cpp ('k') | Source/wtf/text/TextCodec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/encoding/TextDecoder.cpp
diff --git a/Source/modules/encoding/TextDecoder.cpp b/Source/modules/encoding/TextDecoder.cpp
index 42eb5047db3c658370ab03d565083235d1dead58..541540e6674acd489317f1660689209f67eec0a7 100644
--- a/Source/modules/encoding/TextDecoder.cpp
+++ b/Source/modules/encoding/TextDecoder.cpp
@@ -85,10 +85,7 @@ String TextDecoder::decode(ArrayBufferView* input, const Dictionary& options, Ex
const char* start = input ? static_cast<const char*>(input->baseAddress()) : 0;
size_t length = input ? input->byteLength() : 0;
- bool flush = !stream;
-
- // FIXME: Not all TextCodec implementations handle |flush| - notably TextCodecUTF16
- // ignores it and never flushes!
+ WTF::FlushBehavior flush = stream ? WTF::DoNotFlush : WTF::DataEOF;
bool sawError = false;
String s = m_codec->decode(start, length, flush, m_fatal, sawError);
« no previous file with comments | « Source/core/html/parser/TextResourceDecoder.cpp ('k') | Source/wtf/text/TextCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698