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

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

Issue 2140353002: Move StringView constructors into WTFString.h/AtomicString.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused constructor. Created 4 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 | « third_party/WebKit/Source/wtf/text/StringViewTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/text/WTFString.h
diff --git a/third_party/WebKit/Source/wtf/text/WTFString.h b/third_party/WebKit/Source/wtf/text/WTFString.h
index 839454d9a9617bcb2d07f052cd6f3bfe88534bf4..86f6e6bfae8ebd3eb6f36d25d237667142f2bc2a 100644
--- a/third_party/WebKit/Source/wtf/text/WTFString.h
+++ b/third_party/WebKit/Source/wtf/text/WTFString.h
@@ -30,6 +30,7 @@
#include "wtf/WTFExport.h"
#include "wtf/text/ASCIIFastPath.h"
#include "wtf/text/StringImpl.h"
+#include "wtf/text/StringView.h"
#include <algorithm>
#include <iosfwd>
@@ -639,6 +640,13 @@ WTF_EXPORT extern const String& xmlnsWithColon;
// double-quotes, and escapes chracters other than ASCII printables.
WTF_EXPORT std::ostream& operator<<(std::ostream&, const String&);
+inline StringView::StringView(const String& string, unsigned offset, unsigned length)
+ : StringView(string.impl(), offset, length) {}
+inline StringView::StringView(const String& string, unsigned offset)
+ : StringView(string.impl(), offset) {}
+inline StringView::StringView(const String& string)
+ : StringView(string.impl()) {}
+
} // namespace WTF
WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(String);
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringViewTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698