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

Side by Side Diff: net/spdy/spdy_header_block.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 unified diff | Download patch
« no previous file with comments | « net/spdy/hpack/hpack_header_table.cc ('k') | net/tools/quic/quic_dispatcher.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef NET_SPDY_SPDY_HEADER_BLOCK_H_ 5 #ifndef NET_SPDY_SPDY_HEADER_BLOCK_H_
6 #define NET_SPDY_SPDY_HEADER_BLOCK_H_ 6 #define NET_SPDY_SPDY_HEADER_BLOCK_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 17 matching lines...) Expand all
28 // Under the hood, this data structure uses large, contiguous blocks of memory 28 // Under the hood, this data structure uses large, contiguous blocks of memory
29 // to store names and values. Lookups may be performed with StringPiece keys, 29 // to store names and values. Lookups may be performed with StringPiece keys,
30 // and values are returned as StringPieces (via StringPieceProxy, below). 30 // and values are returned as StringPieces (via StringPieceProxy, below).
31 // Value StringPieces are valid as long as the SpdyHeaderBlock exists; allocated 31 // Value StringPieces are valid as long as the SpdyHeaderBlock exists; allocated
32 // memory is never freed until SpdyHeaderBlock's destruction. 32 // memory is never freed until SpdyHeaderBlock's destruction.
33 // 33 //
34 // This implementation does not make much of an effort to minimize wasted space. 34 // This implementation does not make much of an effort to minimize wasted space.
35 // It's expected that keys are rarely deleted from a SpdyHeaderBlock. 35 // It's expected that keys are rarely deleted from a SpdyHeaderBlock.
36 class NET_EXPORT SpdyHeaderBlock { 36 class NET_EXPORT SpdyHeaderBlock {
37 private: 37 private:
38 using MapType = linked_hash_map<base::StringPiece, base::StringPiece>; 38 using MapType = linked_hash_map<base::StringPiece,
39 base::StringPiece,
40 base::StringPieceHash>;
39 class Storage; 41 class Storage;
40 42
41 public: 43 public:
42 using iterator = MapType::iterator; 44 using iterator = MapType::iterator;
43 using const_iterator = MapType::const_iterator; 45 using const_iterator = MapType::const_iterator;
44 using value_type = MapType::value_type; 46 using value_type = MapType::value_type;
45 using reverse_iterator = MapType::reverse_iterator; 47 using reverse_iterator = MapType::reverse_iterator;
46 48
47 class StringPieceProxy; 49 class StringPieceProxy;
48 50
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // to |headers|. |event_param| must have been created by 137 // to |headers|. |event_param| must have been created by
136 // SpdyHeaderBlockNetLogCallback. On failure, returns false and clears 138 // SpdyHeaderBlockNetLogCallback. On failure, returns false and clears
137 // |headers|. 139 // |headers|.
138 NET_EXPORT bool SpdyHeaderBlockFromNetLogParam( 140 NET_EXPORT bool SpdyHeaderBlockFromNetLogParam(
139 const base::Value* event_param, 141 const base::Value* event_param,
140 SpdyHeaderBlock* headers); 142 SpdyHeaderBlock* headers);
141 143
142 } // namespace net 144 } // namespace net
143 145
144 #endif // NET_SPDY_SPDY_HEADER_BLOCK_H_ 146 #endif // NET_SPDY_SPDY_HEADER_BLOCK_H_
OLDNEW
« no previous file with comments | « net/spdy/hpack/hpack_header_table.cc ('k') | net/tools/quic/quic_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698