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

Side by Side Diff: third_party/WebKit/Source/wtf/text/WTFString.cpp

Issue 2394683005: Remove ASSERT_UNUSED (Closed)
Patch Set: Created 4 years, 2 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 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. All rights 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * Copyright (C) 2007-2009 Torch Mobile, Inc. 5 * Copyright (C) 2007-2009 Torch Mobile, Inc.
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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 622
623 char* buffer = bufferVector.data(); 623 char* buffer = bufferVector.data();
624 624
625 if (is8Bit()) { 625 if (is8Bit()) {
626 const LChar* characters = this->characters8(); 626 const LChar* characters = this->characters8();
627 627
628 ConversionResult result = 628 ConversionResult result =
629 convertLatin1ToUTF8(&characters, characters + length, &buffer, 629 convertLatin1ToUTF8(&characters, characters + length, &buffer,
630 buffer + bufferVector.size()); 630 buffer + bufferVector.size());
631 // (length * 3) should be sufficient for any conversion 631 // (length * 3) should be sufficient for any conversion
632 ASSERT_UNUSED(result, result != targetExhausted); 632 DCHECK_NE(result, targetExhausted);
633 } else { 633 } else {
634 const UChar* characters = this->characters16(); 634 const UChar* characters = this->characters16();
635 635
636 if (mode == StrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD) { 636 if (mode == StrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD) {
637 const UChar* charactersEnd = characters + length; 637 const UChar* charactersEnd = characters + length;
638 char* bufferEnd = buffer + bufferVector.size(); 638 char* bufferEnd = buffer + bufferVector.size();
639 while (characters < charactersEnd) { 639 while (characters < charactersEnd) {
640 // Use strict conversion to detect unpaired surrogates. 640 // Use strict conversion to detect unpaired surrogates.
641 ConversionResult result = convertUTF16ToUTF8(&characters, charactersEnd, 641 ConversionResult result = convertUTF16ToUTF8(&characters, charactersEnd,
642 &buffer, bufferEnd, true); 642 &buffer, bufferEnd, true);
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 } 844 }
845 buffer.append('\0'); 845 buffer.append('\0');
846 return buffer; 846 return buffer;
847 } 847 }
848 848
849 Vector<char> asciiDebug(String& string) { 849 Vector<char> asciiDebug(String& string) {
850 return asciiDebug(string.impl()); 850 return asciiDebug(string.impl());
851 } 851 }
852 852
853 #endif 853 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698