Chromium Code Reviews| 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 d110a8c125af30440561d8d7a6b0c1d6b9dc8299..7c707b56db8e0fb74cd07bfc1e501c94310c3564 100644 |
| --- a/Source/core/platform/chromium/support/WebString.cpp |
| +++ b/Source/core/platform/chromium/support/WebString.cpp |
| @@ -34,6 +34,7 @@ |
| #include "public/platform/WebCString.h" |
| #include "wtf/text/AtomicString.h" |
| #include "wtf/text/CString.h" |
| +#include "wtf/text/StringUTF8Adaptor.h" |
| #include "wtf/text/WTFString.h" |
| namespace WebKit { |
| @@ -84,6 +85,12 @@ WebCString WebString::utf8() const |
| return WTF::String(m_private.get()).utf8(); |
| } |
| +std::string WebString::toUTF8String() const |
| +{ |
| + StringUTF8Adaptor utf8(m_private.get()); |
| + return std::string(utf8.data(), utf8.length()); |
| +} |
| + |
| WebString WebString::fromUTF8(const char* data, size_t length) |
| { |
| return WTF::String::fromUTF8(data, length); |
| @@ -99,6 +106,11 @@ bool WebString::equals(const WebString& s) const |
| return equal(m_private.get(), s.m_private.get()); |
| } |
| +bool WebString::lessThan(const WebString& s) const |
| +{ |
| + return m_private.get() < s.m_private.get(); |
|
eseidel
2013/07/24 22:56:17
This looks like a pointer compare...
|
| +} |
| + |
| WebString::WebString(const WTF::String& s) |
| { |
| m_private = s.impl(); |