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

Unified Diff: third_party/WebKit/Source/wtf/text/AtomicString.h

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: fix typo for length access. 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/wtf/text/AtomicString.h
diff --git a/third_party/WebKit/Source/wtf/text/AtomicString.h b/third_party/WebKit/Source/wtf/text/AtomicString.h
index 6fb8300e67062230c00ff1608739dbda098d2f12..41c778a4fe32bba9255661b932ededbd93f61816 100644
--- a/third_party/WebKit/Source/wtf/text/AtomicString.h
+++ b/third_party/WebKit/Source/wtf/text/AtomicString.h
@@ -25,6 +25,7 @@
#include "wtf/HashTableDeletedValueType.h"
#include "wtf/WTFExport.h"
#include "wtf/text/CString.h"
+#include "wtf/text/StringView.h"
#include "wtf/text/WTFString.h"
#include <cstring>
#include <iosfwd>
@@ -233,6 +234,13 @@ inline AtomicString AtomicString::fromUTF8(const char* characters)
return fromUTF8Internal(characters, 0);
}
+inline StringView::StringView(const AtomicString& string)
+ : StringView(string, 0, string.length()) {}
+inline StringView::StringView(const AtomicString& string, unsigned offset, unsigned length)
+ : StringView(string.impl(), offset, length) {}
+inline StringView::StringView(const AtomicString& string, unsigned offset)
+ : StringView(string.impl(), offset) {}
+
// AtomicStringHash is the default hash for AtomicString
template<typename T> struct DefaultHash;
template<> struct DefaultHash<AtomicString> {

Powered by Google App Engine
This is Rietveld 408576698