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

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

Issue 2241573004: Use StringView for String::replace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: woops. Created 4 years, 4 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 | third_party/WebKit/Source/wtf/text/StringImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/text/StringImpl.h
diff --git a/third_party/WebKit/Source/wtf/text/StringImpl.h b/third_party/WebKit/Source/wtf/text/StringImpl.h
index bbb92eceebf2195c8eed8fffee13742b5ba0653c..3642b3003b5a80abf8ad5eaaa6d3296bbfcc7813 100644
--- a/third_party/WebKit/Source/wtf/text/StringImpl.h
+++ b/third_party/WebKit/Source/wtf/text/StringImpl.h
@@ -393,13 +393,12 @@ public:
bool endsWithIgnoringCase(const StringView&) const;
bool endsWithIgnoringASCIICase(const StringView&) const;
- PassRefPtr<StringImpl> replace(UChar, UChar);
- PassRefPtr<StringImpl> replace(UChar, StringImpl*);
- ALWAYS_INLINE PassRefPtr<StringImpl> replace(UChar pattern, const char* replacement, unsigned replacementLength) { return replace(pattern, reinterpret_cast<const LChar*>(replacement), replacementLength); }
- PassRefPtr<StringImpl> replace(UChar, const LChar*, unsigned replacementLength);
- PassRefPtr<StringImpl> replace(UChar, const UChar*, unsigned replacementLength);
- PassRefPtr<StringImpl> replace(StringImpl*, StringImpl*);
- PassRefPtr<StringImpl> replace(unsigned index, unsigned len, StringImpl*);
+ // Replace parts of the string.
+ PassRefPtr<StringImpl> replace(UChar pattern, UChar replacement);
+ PassRefPtr<StringImpl> replace(UChar pattern, const StringView& replacement);
+ PassRefPtr<StringImpl> replace(const StringView& pattern, const StringView& replacement);
+ PassRefPtr<StringImpl> replace(unsigned index, unsigned lengthToReplace, const StringView& replacement);
+
PassRefPtr<StringImpl> upconvertedString();
#if OS(MACOSX)
@@ -421,6 +420,9 @@ private:
return sizeof(StringImpl) + length * sizeof(CharType);
}
+ PassRefPtr<StringImpl> replace(UChar pattern, const LChar* replacement, unsigned replacementLength);
+ PassRefPtr<StringImpl> replace(UChar pattern, const UChar* replacement, unsigned replacementLength);
+
template <class UCharPredicate> PassRefPtr<StringImpl> stripMatchedCharacters(UCharPredicate);
template <typename CharType, class UCharPredicate> PassRefPtr<StringImpl> simplifyMatchedCharactersToSpace(UCharPredicate, StripBehavior);
NEVER_INLINE unsigned hashSlowCase() const;
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/text/StringImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698