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

Unified Diff: third_party/WebKit/Source/platform/text/TextRun.h

Issue 2691443002: Have codePointAt DCHECKS apply to 8bit strings too (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/text/TextRun.h
diff --git a/third_party/WebKit/Source/platform/text/TextRun.h b/third_party/WebKit/Source/platform/text/TextRun.h
index c6c78cec92189d2b274c4f00e0f30c7c87234ff5..2d4660a12286a5b5866c2e22aba68f3138ba6414 100644
--- a/third_party/WebKit/Source/platform/text/TextRun.h
+++ b/third_party/WebKit/Source/platform/text/TextRun.h
@@ -183,19 +183,19 @@ class PLATFORM_EXPORT TextRun final {
}
UChar32 codepointAt(unsigned i) const {
+ SECURITY_DCHECK(i < m_len);
if (is8Bit())
return (*this)[i];
UChar32 codepoint;
- SECURITY_DCHECK(i < m_len);
U16_GET(characters16(), 0, i, m_len, codepoint);
return codepoint;
}
UChar32 codepointAtAndNext(unsigned& i) const {
+ SECURITY_DCHECK(i < m_len);
if (is8Bit())
return (*this)[i++];
UChar32 codepoint;
- SECURITY_DCHECK(i < m_len);
U16_NEXT(characters16(), i, m_len, codepoint);
return codepoint;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698