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

Unified Diff: chrome/browser/browsing_data/canonical_cookie_hash.h

Issue 612323010: Align base::hash_map with C++11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try a different tack for C++ insanity Created 6 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
Index: chrome/browser/browsing_data/canonical_cookie_hash.h
diff --git a/chrome/browser/browsing_data/canonical_cookie_hash.h b/chrome/browser/browsing_data/canonical_cookie_hash.h
index a6905df2fdbd9324e4e7efc2af8316bb7f9a8a98..43055651958bb174d3825e72ba029fb6462684ee 100644
--- a/chrome/browser/browsing_data/canonical_cookie_hash.h
+++ b/chrome/browser/browsing_data/canonical_cookie_hash.h
@@ -21,45 +21,6 @@ namespace canonical_cookie {
// Returns a fast hash of a cookie, based on its name, domain, and path.
size_t FastHash(const net::CanonicalCookie& cookie);
-#if defined(COMPILER_MSVC)
-struct CanonicalCookieTraits {
- static const size_t bucket_size = 4;
-
- // Returns a hash of |cookie|.
- size_t operator()(const net::CanonicalCookie& cookie) const {
- return FastHash(cookie);
- }
-
- // The 'less' operator on cookies. We need to create a total ordering. We
- // order lexigraphically, first by name, then path, then domain. Name is most
- // likely to be distinct, so it is compared first, and domain is least likely
- // to be distinct, so it is compared last.
- bool operator()(const net::CanonicalCookie& cookie1,
- const net::CanonicalCookie& cookie2) const {
- std::less<std::string> less_than;
- if (less_than(cookie1.Name(), cookie2.Name()))
- return true;
- if (less_than(cookie2.Name(), cookie1.Name()))
- return false;
- if (less_than(cookie1.Path(), cookie2.Path()))
- return true;
- if (less_than(cookie2.Path(), cookie1.Path()))
- return false;
- if (less_than(cookie1.Domain(), cookie2.Domain()))
- return true;
- if (less_than(cookie2.Domain(), cookie1.Domain()))
- return false;
-
- // The cookies are equivalent.
- return false;
- }
-};
-
-typedef base::hash_set<net::CanonicalCookie, CanonicalCookieTraits>
- CookieHashSet;
-
-#else // COMPILER_MSVC
-
struct CanonicalCookieHasher {
std::size_t operator()(const net::CanonicalCookie& cookie) const {
return FastHash(cookie);
@@ -79,8 +40,6 @@ typedef base::hash_set<net::CanonicalCookie,
CanonicalCookieHasher,
CanonicalCookieComparer> CookieHashSet;
-#endif // COMPILER_MSVC
-
}; // namespace canonical_cookie
#endif // CHROME_BROWSER_BROWSING_DATA_CANONICAL_COOKIE_HASH_H_

Powered by Google App Engine
This is Rietveld 408576698