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

Unified Diff: third_party/WebKit/Source/platform/exported/WebString.cpp

Issue 2007103003: Expand WTF::StringView's API to be more like StringPiece. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove bad assert. Created 4 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: third_party/WebKit/Source/platform/exported/WebString.cpp
diff --git a/third_party/WebKit/Source/platform/exported/WebString.cpp b/third_party/WebKit/Source/platform/exported/WebString.cpp
index 779bc24125476875147c0f87a1292bc742c3d298..fb2fe76239e95b7241b216ff0317db617626b2ff 100644
--- a/third_party/WebKit/Source/platform/exported/WebString.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebString.cpp
@@ -33,6 +33,7 @@
#include "wtf/text/AtomicString.h"
#include "wtf/text/CString.h"
#include "wtf/text/StringUTF8Adaptor.h"
+#include "wtf/text/StringView.h"
#include "wtf/text/WTFString.h"
namespace blink {
@@ -133,6 +134,11 @@ WebString::operator WTF::String() const
return m_private.get();
}
+WebString::operator WTF::StringView() const
+{
+ return StringView(m_private.get());
+}
+
WebString::WebString(const WTF::AtomicString& s)
{
assign(s.getString());

Powered by Google App Engine
This is Rietveld 408576698