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

Unified Diff: third_party/WebKit/public/platform/WebString.h

Issue 2659023002: Re-add WebString::equals that takes const char* only (Closed)
Patch Set: removes ::fromUTF8(const char*) too Created 3 years, 11 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/platform/exported/WebString.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/public/platform/WebString.h
diff --git a/third_party/WebKit/public/platform/WebString.h b/third_party/WebKit/public/platform/WebString.h
index 85a6832370540f71029f537c0134ede61b97b9a7..c8cbf0f028a82117d4b00f34a0f25e024c7c4010 100644
--- a/third_party/WebKit/public/platform/WebString.h
+++ b/third_party/WebKit/public/platform/WebString.h
@@ -113,6 +113,9 @@ class WebString {
BLINK_COMMON_EXPORT bool equals(const WebString&) const;
BLINK_COMMON_EXPORT bool equals(const char* characters, size_t len) const;
+ bool equals(const char* characters) const {
+ return equals(characters, characters ? strlen(characters) : 0);
+ }
BLINK_COMMON_EXPORT size_t length() const;
@@ -124,8 +127,6 @@ class WebString {
BLINK_COMMON_EXPORT static WebString fromUTF8(const char* data,
size_t length);
- BLINK_COMMON_EXPORT static WebString fromUTF8(const char* data);
-
static WebString fromUTF8(const std::string& s) {
return fromUTF8(s.data(), s.length());
}
@@ -229,7 +230,7 @@ class WebString {
};
inline bool operator==(const WebString& a, const char* b) {
- return a.equals(b, b ? strlen(b) : 0);
+ return a.equals(b);
}
inline bool operator!=(const WebString& a, const char* b) {
« no previous file with comments | « third_party/WebKit/Source/platform/exported/WebString.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698