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

Unified Diff: third_party/WebKit/Source/wtf/text/AtomicString.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/AtomicString.h
diff --git a/third_party/WebKit/Source/wtf/text/AtomicString.h b/third_party/WebKit/Source/wtf/text/AtomicString.h
index b2a8e54bbf49c70607306ced6bb398007ce114f5..f5d1df0ed222c2e1dc3af821a926486cdad82f8c 100644
--- a/third_party/WebKit/Source/wtf/text/AtomicString.h
+++ b/third_party/WebKit/Source/wtf/text/AtomicString.h
@@ -87,21 +87,15 @@ public:
size_t find(const String& s, size_t start = 0, TextCaseSensitivity caseSensitivity = TextCaseSensitive) const
{ return m_string.find(s, start, caseSensitivity); }
- bool startsWith(const String& s, TextCaseSensitivity caseSensitivity = TextCaseSensitive) const
- { return m_string.startsWith(s, caseSensitivity); }
+ bool startsWith(const StringView& prefix, TextCaseSensitivity caseSensitivity = TextCaseSensitive) const
+ { return m_string.startsWith(prefix, caseSensitivity); }
bool startsWith(UChar character) const
{ return m_string.startsWith(character); }
- template<unsigned matchLength>
- bool startsWith(const char (&prefix)[matchLength], TextCaseSensitivity caseSensitivity = TextCaseSensitive) const
- { return m_string.startsWith<matchLength>(prefix, caseSensitivity); }
- bool endsWith(const String& s, TextCaseSensitivity caseSensitivity = TextCaseSensitive) const
- { return m_string.endsWith(s, caseSensitivity); }
+ bool endsWith(const StringView& suffix, TextCaseSensitivity caseSensitivity = TextCaseSensitive) const
+ { return m_string.endsWith(suffix, caseSensitivity); }
bool endsWith(UChar character) const
{ return m_string.endsWith(character); }
- template<unsigned matchLength>
- bool endsWith(const char (&prefix)[matchLength], TextCaseSensitivity caseSensitivity = TextCaseSensitive) const
- { return m_string.endsWith<matchLength>(prefix, caseSensitivity); }
AtomicString lower() const;
AtomicString lowerASCII() const;
@@ -184,9 +178,6 @@ inline bool equalIgnoringCase(const LChar* a, const AtomicString& b) { return eq
inline bool equalIgnoringCase(const char* a, const AtomicString& b) { return equalIgnoringCase(reinterpret_cast<const LChar*>(a), b.impl()); }
inline bool equalIgnoringCase(const String& a, const AtomicString& b) { return equalIgnoringCase(a.impl(), b.impl()); }
-inline bool equalIgnoringASCIICase(const AtomicString& a, const AtomicString& b) { return equalIgnoringASCIICase(a.impl(), b.impl()); }
-inline bool equalIgnoringASCIICase(const AtomicString& a, const char* b) { return equalIgnoringASCIICase(a.impl(), reinterpret_cast<const LChar*>(b)); }
-
// Define external global variables for the commonly used atomic strings.
// These are only usable from the main thread.
WTF_EXPORT extern const AtomicString& nullAtom;

Powered by Google App Engine
This is Rietveld 408576698