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

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

Issue 20135002: Optimize WebURL -> GURL conversions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix logic Created 7 years, 5 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 | Source/core/platform/chromium/support/WebURL.cpp » ('j') | public/platform/WebString.h » ('J')
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 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();
« no previous file with comments | « no previous file | Source/core/platform/chromium/support/WebURL.cpp » ('j') | public/platform/WebString.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698