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

Unified Diff: public/platform/WebString.h

Issue 23456013: Expose latin1 methods in WebString (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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: public/platform/WebString.h
diff --git a/public/platform/WebString.h b/public/platform/WebString.h
index bbddef5b8fb169229a84b04e6caec0a4e2b52d19..be30255e4ab7906b8500a89d5c47107c3bf7d0c3 100644
--- a/public/platform/WebString.h
+++ b/public/platform/WebString.h
@@ -99,6 +99,16 @@ public:
return fromUTF8(s.data(), s.length());
}
+ BLINK_COMMON_EXPORT std::string latin1() const;
+
+ BLINK_COMMON_EXPORT static WebString fromLatin1(const char* data, size_t length);
+ BLINK_COMMON_EXPORT static WebString fromLatin1(const char* data);
+
+ static WebString fromLatin1(const std::string& s)
+ {
+ return fromLatin1(s.data(), s.length());
+ }
+
template <int N> WebString(const char (&data)[N])
{
assign(fromUTF8(data, N - 1));

Powered by Google App Engine
This is Rietveld 408576698