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

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

Issue 2919653004: Use LOG() or LOG_IF() instead of IMMEDIATE_CRASH (Closed)
Patch Set: Use LOG() or CHECK()|CHECK_FOO() instead of IMMEDIATE_CRASH 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 unified diff | Download patch
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 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 int last_typed_character_offset_; 102 int last_typed_character_offset_;
103 }; 103 };
104 104
105 static void MakeCapitalized(String* string, UChar previous) { 105 static void MakeCapitalized(String* string, UChar previous) {
106 if (string->IsNull()) 106 if (string->IsNull())
107 return; 107 return;
108 108
109 unsigned length = string->length(); 109 unsigned length = string->length();
110 const StringImpl& input = *string->Impl(); 110 const StringImpl& input = *string->Impl();
111 111
112 if (length >= std::numeric_limits<unsigned>::max()) 112 CHECK_LT(length, std::numeric_limits<unsigned>::max());
113 IMMEDIATE_CRASH();
114
115 StringBuffer<UChar> string_with_previous(length + 1); 113 StringBuffer<UChar> string_with_previous(length + 1);
116 string_with_previous[0] = 114 string_with_previous[0] =
117 previous == kNoBreakSpaceCharacter ? kSpaceCharacter : previous; 115 previous == kNoBreakSpaceCharacter ? kSpaceCharacter : previous;
118 for (unsigned i = 1; i < length + 1; i++) { 116 for (unsigned i = 1; i < length + 1; i++) {
119 // Replace &nbsp with a real space since ICU no longer treats &nbsp as a 117 // Replace &nbsp with a real space since ICU no longer treats &nbsp as a
120 // word separator. 118 // word separator.
121 if (input[i - 1] == kNoBreakSpaceCharacter) 119 if (input[i - 1] == kNoBreakSpaceCharacter)
122 string_with_previous[i] = kSpaceCharacter; 120 string_with_previous[i] = kSpaceCharacter;
123 else 121 else
124 string_with_previous[i] = input[i - 1]; 122 string_with_previous[i] = input[i - 1];
(...skipping 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after
2001 LayoutRect rect = LayoutRect( 1999 LayoutRect rect = LayoutRect(
2002 IntRect(FirstRunX(), FirstRunY(), lines_box.Width(), lines_box.Height())); 2000 IntRect(FirstRunX(), FirstRunY(), lines_box.Width(), lines_box.Height()));
2003 LayoutBlock* block = ContainingBlock(); 2001 LayoutBlock* block = ContainingBlock();
2004 if (block && HasTextBoxes()) 2002 if (block && HasTextBoxes())
2005 block->AdjustChildDebugRect(rect); 2003 block->AdjustChildDebugRect(rect);
2006 2004
2007 return rect; 2005 return rect;
2008 } 2006 }
2009 2007
2010 } // namespace blink 2008 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableRow.h ('k') | third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698