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

Side by Side Diff: net/spdy/hpack/hpack_header_table.cc

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 unified diff | Download patch
« no previous file with comments | « net/spdy/hpack/hpack_header_table.h ('k') | net/spdy/spdy_header_block.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/spdy/hpack/hpack_header_table.h" 5 #include "net/spdy/hpack/hpack_header_table.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "net/spdy/hpack/hpack_constants.h" 10 #include "net/spdy/hpack/hpack_constants.h"
11 #include "net/spdy/hpack/hpack_static_table.h" 11 #include "net/spdy/hpack/hpack_static_table.h"
12 12
13 namespace net { 13 namespace net {
14 14
15 using base::StringPiece; 15 using base::StringPiece;
16 16
17 size_t HpackHeaderTable::EntryHasher::operator()( 17 size_t HpackHeaderTable::EntryHasher::operator()(
18 const HpackEntry* entry) const { 18 const HpackEntry* entry) const {
19 return BASE_HASH_NAMESPACE::hash<base::StringPiece>()(entry->name()) ^ 19 return base::StringPieceHash()(entry->name()) ^
20 BASE_HASH_NAMESPACE::hash<base::StringPiece>()(entry->value()); 20 base::StringPieceHash()(entry->value());
21 } 21 }
22 22
23 bool HpackHeaderTable::EntriesEq::operator()(const HpackEntry* lhs, 23 bool HpackHeaderTable::EntriesEq::operator()(const HpackEntry* lhs,
24 const HpackEntry* rhs) const { 24 const HpackEntry* rhs) const {
25 if (lhs == nullptr) { 25 if (lhs == nullptr) {
26 return rhs == nullptr; 26 return rhs == nullptr;
27 } 27 }
28 if (rhs == nullptr) { 28 if (rhs == nullptr) {
29 return false; 29 return false;
30 } 30 }
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 for (const auto entry : dynamic_index_) { 242 for (const auto entry : dynamic_index_) {
243 DVLOG(2) << " " << entry->GetDebugString(); 243 DVLOG(2) << " " << entry->GetDebugString();
244 } 244 }
245 DVLOG(2) << "Full Dynamic Name Index:"; 245 DVLOG(2) << "Full Dynamic Name Index:";
246 for (const auto it : dynamic_name_index_) { 246 for (const auto it : dynamic_name_index_) {
247 DVLOG(2) << " " << it.first << ": " << it.second->GetDebugString(); 247 DVLOG(2) << " " << it.first << ": " << it.second->GetDebugString();
248 } 248 }
249 } 249 }
250 250
251 } // namespace net 251 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/hpack/hpack_header_table.h ('k') | net/spdy/spdy_header_block.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698