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

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

Issue 2146163003: Use StringView for startsWith and endsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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 c1cb3ee476a0cd58c856f9264baef345c26c8128..a95a0d9d2cf4234abf86ae9d8b52bb744fa03eec 100644
--- a/third_party/WebKit/Source/wtf/text/StringImpl.h
+++ b/third_party/WebKit/Source/wtf/text/StringImpl.h
@@ -383,20 +383,14 @@ public:
size_t reverseFind(StringImpl*, unsigned index = UINT_MAX);
bool startsWith(UChar) const;
- bool startsWith(const char*, unsigned prefixLength) const;
- bool startsWith(const StringImpl*) const;
- bool startsWithIgnoringCase(const char*, unsigned prefixLength) const;
- bool startsWithIgnoringCase(const StringImpl*) const;
- bool startsWithIgnoringASCIICase(const char*, unsigned prefixLength) const;
- bool startsWithIgnoringASCIICase(const StringImpl*) const;
+ bool startsWith(const StringView&) const;
+ bool startsWithIgnoringCase(const StringView&) const;
+ bool startsWithIgnoringASCIICase(const StringView&) const;
bool endsWith(UChar) const;
- bool endsWith(const char*, unsigned suffixLength) const;
- bool endsWith(const StringImpl*) const;
- bool endsWithIgnoringCase(const char*, unsigned suffixLength) const;
- bool endsWithIgnoringCase(const StringImpl*) const;
- bool endsWithIgnoringASCIICase(const char*, unsigned suffixLength) const;
- bool endsWithIgnoringASCIICase(const StringImpl*) const;
+ bool endsWith(const StringView&) const;
+ bool endsWithIgnoringCase(const StringView&) const;
+ bool endsWithIgnoringASCIICase(const StringView&) const;
PassRefPtr<StringImpl> replace(UChar, UChar);
PassRefPtr<StringImpl> replace(UChar, StringImpl*);
@@ -511,16 +505,6 @@ inline bool equalIgnoringASCIICase(const CharacterTypeA* a, const CharacterTypeB
return true;
}
-WTF_EXPORT bool equalIgnoringASCIICase(const StringImpl*, const StringImpl*);
-WTF_EXPORT bool equalIgnoringASCIICase(const StringImpl*, const LChar*, unsigned length);
-inline bool equalIgnoringASCIICase(const StringImpl* a, const char* b, unsigned length) { return equalIgnoringASCIICase(a, reinterpret_cast<const LChar*>(b), length); }
-inline bool equalIgnoringASCIICase(const StringImpl* a, const LChar* b)
-{
- size_t length = b ? strlen(reinterpret_cast<const char*>(b)) : 0;
- return equalIgnoringASCIICase(a, b, length);
-}
-inline bool equalIgnoringASCIICase(const StringImpl* a, const char* b) { return equalIgnoringASCIICase(a, reinterpret_cast<const LChar*>(b)); }
esprehn 2016/07/13 23:42:56 These are all handled by the one defined in String
-
WTF_EXPORT int codePointCompareIgnoringASCIICase(const StringImpl*, const LChar*);
inline size_t find(const LChar* characters, unsigned length, LChar matchCharacter, unsigned index = 0)

Powered by Google App Engine
This is Rietveld 408576698