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

Side by Side Diff: third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp

Issue 2588193003: Add RELEASE_ASSERT to InlineTextBox::constructTextRun (Closed)
Patch Set: Add comment Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 } 609 }
610 610
611 TextRun InlineTextBox::constructTextRun( 611 TextRun InlineTextBox::constructTextRun(
612 const ComputedStyle& style, 612 const ComputedStyle& style,
613 StringBuilder* charactersWithHyphen) const { 613 StringBuilder* charactersWithHyphen) const {
614 ASSERT(getLineLayoutItem().text()); 614 ASSERT(getLineLayoutItem().text());
615 615
616 String string = getLineLayoutItem().text(); 616 String string = getLineLayoutItem().text();
617 unsigned startPos = start(); 617 unsigned startPos = start();
618 unsigned length = len(); 618 unsigned length = len();
619 // Ensure |this| is in sync with the corresponding LayoutText. Checking here
620 // has less binary size/perf impact than in StringView().
621 RELEASE_ASSERT(startPos <= string.length() &&
622 length <= string.length() - startPos);
619 return constructTextRun(style, StringView(string, startPos, length), 623 return constructTextRun(style, StringView(string, startPos, length),
620 getLineLayoutItem().textLength() - startPos, 624 getLineLayoutItem().textLength() - startPos,
621 charactersWithHyphen); 625 charactersWithHyphen);
622 } 626 }
623 627
624 TextRun InlineTextBox::constructTextRun( 628 TextRun InlineTextBox::constructTextRun(
625 const ComputedStyle& style, 629 const ComputedStyle& style,
626 StringView string, 630 StringView string,
627 int maximumLength, 631 int maximumLength,
628 StringBuilder* charactersWithHyphen) const { 632 StringBuilder* charactersWithHyphen) const {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 const int layoutObjectCharacterOffset = 75; 687 const int layoutObjectCharacterOffset = 75;
684 for (; printedCharacters < layoutObjectCharacterOffset; printedCharacters++) 688 for (; printedCharacters < layoutObjectCharacterOffset; printedCharacters++)
685 fputc(' ', stderr); 689 fputc(' ', stderr);
686 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), 690 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(),
687 value.utf8().data()); 691 value.utf8().data());
688 } 692 }
689 693
690 #endif 694 #endif
691 695
692 } // namespace blink 696 } // namespace blink
OLDNEW
« 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