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

Unified Diff: url/gurl.h

Issue 2421383003: Add operator==(const GURL&, const StringPiece&) to gurl.h (Closed)
Patch Set: remove comment Created 4 years, 2 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 | « net/quic/chromium/quic_stream_factory_test.cc ('k') | url/gurl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/gurl.h
diff --git a/url/gurl.h b/url/gurl.h
index c9111d3684992d457486ed04cb47c616396cf345..ce7e33c0181b01f5df447219f8fb5aa8f424fc7d 100644
--- a/url/gurl.h
+++ b/url/gurl.h
@@ -132,10 +132,6 @@ class URL_EXPORT GURL {
return parsed_;
}
- // Defiant equality operator!
- bool operator==(const GURL& other) const;
- bool operator!=(const GURL& other) const;
-
// Allows GURL to used as a key in STL (for example, a std::set or std::map).
bool operator<(const GURL& other) const;
bool operator>(const GURL& other) const;
@@ -447,4 +443,13 @@ class URL_EXPORT GURL {
// Stream operator so GURL can be used in assertion statements.
URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url);
+URL_EXPORT bool operator==(const GURL& x, const GURL& y);
+URL_EXPORT bool operator!=(const GURL& x, const GURL& y);
+
+// Equality operator for comparing raw spec_. This should be used in place of
+// url == GURL(spec) where |spec| is known (i.e. constants). This is to prevent
+// needlessly re-parsing |spec| into a temporary GURL.
+URL_EXPORT bool operator==(const GURL& x, const base::StringPiece& spec);
+URL_EXPORT bool operator!=(const GURL& x, const base::StringPiece& spec);
+
#endif // URL_GURL_H_
« no previous file with comments | « net/quic/chromium/quic_stream_factory_test.cc ('k') | url/gurl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698