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

Unified Diff: third_party/WebKit/Source/wtf/text/TextCodecICU.cpp

Issue 2235453002: Text Encoding: Fix "stop on error" for ICU-based codecs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove explicit default code path Created 4 years, 4 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 | « third_party/WebKit/LayoutTests/imported/wpt/encoding/textdecoder-fatal-single-byte-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/text/TextCodecICU.cpp
diff --git a/third_party/WebKit/Source/wtf/text/TextCodecICU.cpp b/third_party/WebKit/Source/wtf/text/TextCodecICU.cpp
index b2c4d3f58a17c8be4cd1af6af838618de3809e26..3d1c0caa7f359d9db3319db0663b22ea51d40556 100644
--- a/third_party/WebKit/Source/wtf/text/TextCodecICU.cpp
+++ b/third_party/WebKit/Source/wtf/text/TextCodecICU.cpp
@@ -313,10 +313,8 @@ public:
{
if (m_shouldStopOnEncodingErrors) {
UErrorCode err = U_ZERO_ERROR;
- ucnv_setToUCallBack(m_converter, UCNV_TO_U_CALLBACK_SUBSTITUTE,
- UCNV_SUB_STOP_ON_ILLEGAL, &m_savedAction,
- &m_savedContext, &err);
- ASSERT(err == U_ZERO_ERROR);
+ ucnv_setToUCallBack(m_converter, UCNV_TO_U_CALLBACK_STOP, 0, &m_savedAction, &m_savedContext, &err);
+ DCHECK_EQ(err, U_ZERO_ERROR);
}
}
~ErrorCallbackSetter()
@@ -326,9 +324,9 @@ public:
const void* oldContext;
UConverterToUCallback oldAction;
ucnv_setToUCallBack(m_converter, m_savedAction, m_savedContext, &oldAction, &oldContext, &err);
- ASSERT(oldAction == UCNV_TO_U_CALLBACK_SUBSTITUTE);
- ASSERT(!strcmp(static_cast<const char*>(oldContext), UCNV_SUB_STOP_ON_ILLEGAL));
- ASSERT(err == U_ZERO_ERROR);
+ DCHECK_EQ(oldAction, UCNV_TO_U_CALLBACK_STOP);
+ DCHECK(!oldContext);
+ DCHECK_EQ(err, U_ZERO_ERROR);
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/imported/wpt/encoding/textdecoder-fatal-single-byte-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698