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

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

Issue 2931673004: Make InlineBoxPosition constructor not to accept null-InlineBox (Closed)
Patch Set: 2017-06-12T14:51:57 Created 3 years, 6 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.h
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnits.h b/third_party/WebKit/Source/core/editing/VisibleUnits.h
index 16e3a9e499db51575e161d09c89b7ffb27efdc65..77618f7264d228375dbc362c4fca12df683bb2de 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnits.h
+++ b/third_party/WebKit/Source/core/editing/VisibleUnits.h
@@ -52,7 +52,10 @@ struct InlineBoxPosition {
InlineBoxPosition() : inline_box(nullptr), offset_in_box(0) {}
InlineBoxPosition(InlineBox* inline_box, int offset_in_box)
- : inline_box(inline_box), offset_in_box(offset_in_box) {}
+ : inline_box(inline_box), offset_in_box(offset_in_box) {
+ DCHECK(inline_box);
+ DCHECK_GE(offset_in_box, 0);
+ }
bool operator==(const InlineBoxPosition& other) const {
return inline_box == other.inline_box &&

Powered by Google App Engine
This is Rietveld 408576698