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

Unified Diff: third_party/WebKit/Source/wtf/text/WTFString.h

Issue 1768063002: Introduce String::fromUTF8Lenient() and use it for cache_name in CacheStorage API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: third_party/WebKit/Source/wtf/text/WTFString.h
diff --git a/third_party/WebKit/Source/wtf/text/WTFString.h b/third_party/WebKit/Source/wtf/text/WTFString.h
index 0b1b4ea8fd153ea6f4baae0726940c95b34a97f1..b1ae55aef1110daf32afb947c8cd94bf6f916ee9 100644
--- a/third_party/WebKit/Source/wtf/text/WTFString.h
+++ b/third_party/WebKit/Source/wtf/text/WTFString.h
@@ -430,7 +430,7 @@ public:
// String::fromUTF8 will return a null string if
// the input data contains invalid UTF-8 sequences.
- static String fromUTF8(const LChar*, size_t);
+ static String fromUTF8(const LChar*, size_t, bool strict = true);
jsbell 2016/03/08 20:28:15 Please update the documentation.
horo 2016/03/09 01:58:40 Done.
static String fromUTF8(const LChar*);
static String fromUTF8(const char* s, size_t length) { return fromUTF8(reinterpret_cast<const LChar*>(s), length); }
static String fromUTF8(const char* s) { return fromUTF8(reinterpret_cast<const LChar*>(s)); }
@@ -441,6 +441,9 @@ public:
static String fromUTF8WithLatin1Fallback(const LChar*, size_t);
static String fromUTF8WithLatin1Fallback(const char* s, size_t length) { return fromUTF8WithLatin1Fallback(reinterpret_cast<const LChar*>(s), length); }
+ static String fromUTF8Lenient(const LChar* s, size_t length) { return fromUTF8(s, length, false); }
jsbell 2016/03/08 20:28:15 Please add documentation.
horo 2016/03/09 01:58:40 Done.
+ static String fromUTF8Lenient(const char* s, size_t length) { return fromUTF8Lenient(reinterpret_cast<const LChar*>(s), length); }
+
bool containsOnlyASCII() const;
bool containsOnlyLatin1() const;
bool containsOnlyWhitespace() const { return !m_impl || m_impl->containsOnlyWhitespace(); }

Powered by Google App Engine
This is Rietveld 408576698