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

Unified Diff: third_party/WebKit/Source/core/editing/VisibleUnits.cpp

Issue 2368903002: Ensure valid VisiblePosition input for character{Before,After} (Closed)
Patch Set: Ensure valid VisiblePosition input for character{Before,After} Created 4 years, 3 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
Index: third_party/WebKit/Source/core/editing/VisibleUnits.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
index d5e2463f6bc0514c384c714ae2689d8ed1eaef36..83d953f8274ba2b5e381c061523ff4190257fd90 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
@@ -2984,8 +2984,7 @@ static VisiblePositionTemplate<Strategy> skipToEndOfEditingBoundary(const Visibl
template <typename Strategy>
static UChar32 characterAfterAlgorithm(const VisiblePositionTemplate<Strategy>& visiblePosition)
{
- // TODO(xiaochengh): Ensure that this function is called with a valid
- // |visiblePosition|, and add |DCHECK(visiblePosition.isValid())|
+ DCHECK(visiblePosition.isValid()) << visiblePosition;
// We canonicalize to the first of two equivalent candidates, but the second
// of the two candidates is the one that will be inside the text node
// containing the character after this visible position.
@@ -3017,8 +3016,7 @@ UChar32 characterAfter(const VisiblePositionInFlatTree& visiblePosition)
template <typename Strategy>
static UChar32 characterBeforeAlgorithm(const VisiblePositionTemplate<Strategy>& visiblePosition)
yosin_UTC9 2016/09/27 08:30:53 Not sure how about making |characterAfter()| to ta
Xiaocheng 2016/09/27 08:48:51 Talked offline. A lot of functions in VisibleUnits
{
- // TODO(xiaochengh): Ensure that this function is called with a valid
- // |visiblePosition|, and add |DCHECK(visiblePosition.isValid())|
+ DCHECK(visiblePosition.isValid()) << visiblePosition;
return characterAfter(previousPositionOf(visiblePosition));
}

Powered by Google App Engine
This is Rietveld 408576698