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

Unified Diff: Source/core/platform/chromium/support/WebString.cpp

Issue 15866003: Teach WebString about 8 bit strings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Better std::string pattern Created 7 years, 7 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: Source/core/platform/chromium/support/WebString.cpp
diff --git a/Source/core/platform/chromium/support/WebString.cpp b/Source/core/platform/chromium/support/WebString.cpp
index 17649317babf081f32266f1395a0778b7621cb8c..8f9b9a63f1a86c847525b7340f197cb2ae40183c 100644
--- a/Source/core/platform/chromium/support/WebString.cpp
+++ b/Source/core/platform/chromium/support/WebString.cpp
@@ -70,6 +70,23 @@ const WebUChar* WebString::data() const
return m_private ? const_cast<WebStringPrivate*>(m_private)->characters() : 0;
}
+bool WebString::is8Bit() const
+{
+ return m_private->is8Bit();
+}
+
+const WebLChar* WebString::data8() const
+{
+ ASSERT(is8Bit());
+ return m_private->characters8();
+}
+
+const WebUChar* WebString::data16() const
+{
+ ASSERT(!is8Bit());
+ return m_private->characters16();
+}
+
WebCString WebString::utf8() const
{
return WTF::String(m_private).utf8();

Powered by Google App Engine
This is Rietveld 408576698