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

Unified Diff: Source/wtf/text/WTFString.cpp

Issue 124003003: Add ascii() / latin1() / utf8() methods to AtomicString to avoid having to call string() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 12 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
« no previous file with comments | « Source/wtf/text/WTFString.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/WTFString.cpp
diff --git a/Source/wtf/text/WTFString.cpp b/Source/wtf/text/WTFString.cpp
index 470de66f0495f5f6e20704a5ef4aac0315676f27..f79e7ee60d4919e6500e1260f1e492e45f0caacd 100644
--- a/Source/wtf/text/WTFString.cpp
+++ b/Source/wtf/text/WTFString.cpp
@@ -792,7 +792,7 @@ static inline void putUTF8Triple(char*& buffer, UChar ch)
*buffer++ = static_cast<char>((ch & 0x3F) | 0x80);
}
-CString String::utf8(ConversionMode mode) const
+CString String::utf8(UTF8ConversionMode mode) const
{
unsigned length = this->length();
@@ -823,7 +823,7 @@ CString String::utf8(ConversionMode mode) const
} else {
const UChar* characters = this->characters16();
- if (mode == StrictConversionReplacingUnpairedSurrogatesWithFFFD) {
+ if (mode == StrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD) {
const UChar* charactersEnd = characters + length;
char* bufferEnd = buffer + bufferVector.size();
while (characters < charactersEnd) {
@@ -841,7 +841,7 @@ CString String::utf8(ConversionMode mode) const
}
}
} else {
- bool strict = mode == StrictConversion;
+ bool strict = mode == StrictUTF8Conversion;
ConversionResult result = convertUTF16ToUTF8(&characters, characters + length, &buffer, buffer + bufferVector.size(), strict);
ASSERT(result != targetExhausted); // (length * 3) should be sufficient for any conversion
« no previous file with comments | « Source/wtf/text/WTFString.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698