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

Unified Diff: net/quic/quic_blocked_writer_interface.h

Issue 1666843002: Refactor StringPiece hash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Define hash on all compilers. 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
Index: net/quic/quic_blocked_writer_interface.h
diff --git a/net/quic/quic_blocked_writer_interface.h b/net/quic/quic_blocked_writer_interface.h
index 78a270af12f685636bf3bf495b5965e3a9ca6ae6..a3a2622a599d561a226371b6b888b2b3e5a9903f 100644
--- a/net/quic/quic_blocked_writer_interface.h
+++ b/net/quic/quic_blocked_writer_interface.h
@@ -24,20 +24,15 @@ class NET_EXPORT_PRIVATE QuicBlockedWriterInterface {
virtual void OnCanWrite() = 0;
};
-} // namespace net
-
-#if defined(COMPILER_GCC)
Bence 2016/02/04 16:32:00 I believe that this hash<> specialization was orig
davidben 2016/02/04 19:45:09 +rch should probably review the QUIC bits, especia
Ryan Hamilton 2016/02/04 20:15:14 Interestingly, the internal version does not need
-namespace BASE_HASH_NAMESPACE {
// Hash pointers as if they were int's, but bring more entropy to the lower
// bits.
-template <>
-struct hash<net::QuicBlockedWriterInterface*> {
+struct QuicBlockedWriterInterfacePtrHash {
std::size_t operator()(const net::QuicBlockedWriterInterface* ptr) const {
size_t k = reinterpret_cast<size_t>(ptr);
return k + (k >> 6);
}
};
-}
-#endif
+
+} // namespace net
#endif // NET_QUIC_QUIC_BLOCKED_WRITER_INTERFACE_H_

Powered by Google App Engine
This is Rietveld 408576698