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

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: Update to base 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
« no previous file with comments | « no previous file | public/platform/WebCommon.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c738683ac226fc06ea9c49806804581af12fca44..3f0a3d9eb8dbaa59d17a5ec3d4524cdd81a9d80c 100644
--- a/Source/core/platform/chromium/support/WebString.cpp
+++ b/Source/core/platform/chromium/support/WebString.cpp
@@ -75,6 +75,21 @@ 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
+{
+ return m_private && is8Bit() ? m_private->characters8() : 0;
+}
+
+const WebUChar* WebString::data16() const
+{
+ return m_private && !is8Bit() ? m_private->characters16() : 0;
+}
+
WebCString WebString::utf8() const
{
return WTF::String(m_private).utf8();
« no previous file with comments | « no previous file | public/platform/WebCommon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698