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

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

Issue 623383002: Align base::hash_map with C++11, part 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hash-1
Patch Set: clean up stale includes 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
« no previous file with comments | « cc/surfaces/surface_id.h ('k') | chrome/browser/sync_file_system/drive_backend/metadata_database_index.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..aeb79bdf93964ef8ab9c3ad74962fe6a8afac87a 100644
--- a/chrome/browser/browsing_data/canonical_cookie_hash.h
+++ b/chrome/browser/browsing_data/canonical_cookie_hash.h
@@ -9,10 +9,6 @@
#ifndef CHROME_BROWSER_BROWSING_DATA_CANONICAL_COOKIE_HASH_H_
#define CHROME_BROWSER_BROWSING_DATA_CANONICAL_COOKIE_HASH_H_
-#if defined(COMPILER_MSVC)
-#include <functional>
-#endif // COMPILER_MSVC
-
#include "base/containers/hash_tables.h"
#include "net/cookies/canonical_cookie.h"
@@ -21,45 +17,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 +36,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_
« no previous file with comments | « cc/surfaces/surface_id.h ('k') | chrome/browser/sync_file_system/drive_backend/metadata_database_index.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698