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

Unified Diff: net/http/http_server_properties_impl.h

Issue 1666843002: Refactor StringPiece hash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sort includes. Created 4 years, 10 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/dns/dns_hosts.h ('k') | net/quic/quic_blocked_writer_interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_server_properties_impl.h
diff --git a/net/http/http_server_properties_impl.h b/net/http/http_server_properties_impl.h
index b8678bed747dee9e178573d08fe1ac42391194c6..6b83053f0c6b6528e089a4cc17d1e776375c1430 100644
--- a/net/http/http_server_properties_impl.h
+++ b/net/http/http_server_properties_impl.h
@@ -14,7 +14,6 @@
#include <string>
#include <vector>
-#include "base/containers/hash_tables.h"
#include "base/macros.h"
#include "base/threading/non_thread_safe.h"
#include "base/values.h"
@@ -27,19 +26,14 @@ namespace base {
class ListValue;
}
-namespace BASE_HASH_NAMESPACE {
+namespace net {
-template <>
-struct hash<net::AlternativeService> {
+struct AlternativeServiceHash {
size_t operator()(const net::AlternativeService& entry) const {
- return entry.protocol ^ hash<std::string>()(entry.host) ^ entry.port;
+ return entry.protocol ^ std::hash<std::string>()(entry.host) ^ entry.port;
}
};
-} // namespace BASE_HASH_NAMESPACE
-
-namespace net {
-
// The implementation for setting/retrieving the HTTP server properties.
class NET_EXPORT HttpServerPropertiesImpl
: public HttpServerProperties,
@@ -151,7 +145,9 @@ class NET_EXPORT HttpServerPropertiesImpl
// Linked hash map from AlternativeService to expiration time. This container
// is a queue with O(1) enqueue and dequeue, and a hash_map with O(1) lookup
// at the same time.
- typedef linked_hash_map<AlternativeService, base::TimeTicks>
+ typedef linked_hash_map<AlternativeService,
+ base::TimeTicks,
+ AlternativeServiceHash>
BrokenAlternativeServices;
// Map to the number of times each alternative service has been marked broken.
typedef std::map<AlternativeService, int> RecentlyBrokenAlternativeServices;
« no previous file with comments | « net/dns/dns_hosts.h ('k') | net/quic/quic_blocked_writer_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698