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

Unified Diff: public/platform/WebString.h

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
Index: public/platform/WebString.h
diff --git a/public/platform/WebString.h b/public/platform/WebString.h
index 7d607d77d708a5b0b1147aa02de8af091bc38826..81809f9aaad4dcc0a2f82c88b78f93539eece66d 100644
--- a/public/platform/WebString.h
+++ b/public/platform/WebString.h
@@ -33,6 +33,7 @@
#include "WebCommon.h"
#include "WebPrivatePtr.h"
+#include <string>
#if INSIDE_WEBKIT
#include <wtf/Forward.h>
@@ -79,6 +80,7 @@ public:
BLINK_COMMON_EXPORT void assign(const WebUChar* data, size_t len);
BLINK_COMMON_EXPORT bool equals(const WebString&) const;
+ BLINK_COMMON_EXPORT bool lessThan(const WebString&) const;
BLINK_COMMON_EXPORT size_t length() const;
@@ -89,6 +91,7 @@ public:
bool isNull() const { return m_private.isNull(); }
BLINK_COMMON_EXPORT WebCString utf8() const;
+ BLINK_COMMON_EXPORT std::string toUTF8String() const;
abarth-chromium 2013/07/24 21:59:10 I'm not super happy with this name... Open to sug
Jeffrey Yasskin 2013/07/24 22:23:20 It would be clearer if it mentioned "std", but it
BLINK_COMMON_EXPORT static WebString fromUTF8(const char* data, size_t length);
BLINK_COMMON_EXPORT static WebString fromUTF8(const char* data);
@@ -169,6 +172,11 @@ private:
WebPrivatePtr<WTF::StringImpl> m_private;
};
+inline bool operator<(const WebString& a, const WebString& b)
+{
+ return a.lessThan(b);
+}
+
inline bool operator==(const WebString& a, const WebString& b)
{
return a.equals(b);

Powered by Google App Engine
This is Rietveld 408576698