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

Unified Diff: third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp

Issue 1860883002: Introduce DCHECK() in expandToParagraphBoundary() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/core/editing/spellcheck/TextCheckingHelper.cpp
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp b/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp
index c908db9373c612a2f6c1832f4cae5d7081eec1e2..51c49f89d7d6036d139a0a00db52d77c867d3385 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp
@@ -97,7 +97,17 @@ static void findMisspellings(TextCheckerClient& client, const UChar* text, int s
static EphemeralRange expandToParagraphBoundary(const EphemeralRange& range)
{
- return EphemeralRange(startOfParagraph(createVisiblePosition(range.startPosition())).deepEquivalent(), endOfParagraph(createVisiblePosition(range.endPosition())).deepEquivalent());
+ const VisiblePosition& start = createVisiblePosition(range.startPosition());
+ DCHECK(start.isNotNull()) << range.startPosition();
+ const VisiblePosition& paragraphStart = startOfParagraph(start);
+ DCHECK(paragraphStart.isNotNull()) << range.startPosition();
+
+ const VisiblePosition& end = createVisiblePosition(range.endPosition());
+ DCHECK(end.isNotNull()) << range.endPosition();
+ const VisiblePosition& paragraphEnd = endOfParagraph(end);
+ DCHECK(paragraphEnd.isNotNull()) << range.endPosition();
+
+ return EphemeralRange(paragraphStart.deepEquivalent(), paragraphEnd.deepEquivalent());
}
TextCheckingParagraph::TextCheckingParagraph(const EphemeralRange& checkingRange)
« 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