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

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

Issue 2770123003: Replace ASSERT with DCHECK in core/layout/ excluding subdirs (Closed)
Patch Set: Split some DCHECKs and add DCHECK_ops wherever possible Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 TextDirection direction) { 89 TextDirection direction) {
90 return constructTextRunInternal(font, characters, length, style, direction); 90 return constructTextRunInternal(font, characters, length, style, direction);
91 } 91 }
92 92
93 TextRun constructTextRun(const Font& font, 93 TextRun constructTextRun(const Font& font,
94 const LayoutText* text, 94 const LayoutText* text,
95 unsigned offset, 95 unsigned offset,
96 unsigned length, 96 unsigned length,
97 const ComputedStyle& style, 97 const ComputedStyle& style,
98 TextDirection direction) { 98 TextDirection direction) {
99 ASSERT(offset + length <= text->textLength()); 99 DCHECK_LE(offset + length, text->textLength());
100 if (text->hasEmptyText()) 100 if (text->hasEmptyText())
101 return constructTextRunInternal(font, static_cast<const LChar*>(nullptr), 0, 101 return constructTextRunInternal(font, static_cast<const LChar*>(nullptr), 0,
102 style, direction); 102 style, direction);
103 if (text->is8Bit()) 103 if (text->is8Bit())
104 return constructTextRunInternal(font, text->characters8() + offset, length, 104 return constructTextRunInternal(font, text->characters8() + offset, length,
105 style, direction); 105 style, direction);
106 return constructTextRunInternal(font, text->characters16() + offset, length, 106 return constructTextRunInternal(font, text->characters16() + offset, length,
107 style, direction); 107 style, direction);
108 } 108 }
109 109
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 style, TextDirection::kLtr); 149 style, TextDirection::kLtr);
150 } 150 }
151 151
152 TextRun run = constructTextRunInternal(font, text.characters16() + offset, 152 TextRun run = constructTextRunInternal(font, text.characters16() + offset,
153 length, style, TextDirection::kLtr); 153 length, style, TextDirection::kLtr);
154 run.setDirection(directionForRun(run)); 154 run.setDirection(directionForRun(run));
155 return run; 155 return run;
156 } 156 }
157 157
158 } // namespace blink 158 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698