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

Side by Side Diff: net/quic/platform/impl/quic_containers_impl.h

Issue 2825853002: Improvements to uses of base::SmallMap (Closed)
Patch Set: Review comments Created 3 years, 8 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 | « ipc/ipc_message_utils_unittest.cc ('k') | storage/browser/blob/blob_memory_controller.cc » ('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) 2017 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2017 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_QUIC_PLATFORM_IMPL_QUIC_CONTAINERS_IMPL_H_ 5 #ifndef NET_QUIC_PLATFORM_IMPL_QUIC_CONTAINERS_IMPL_H_
6 #define NET_QUIC_PLATFORM_IMPL_QUIC_CONTAINERS_IMPL_H_ 6 #define NET_QUIC_PLATFORM_IMPL_QUIC_CONTAINERS_IMPL_H_
7 7
8 #include <unordered_map> 8 #include <unordered_map>
9 9
10 #include "base/containers/small_map.h" 10 #include "base/containers/small_map.h"
11 #include "net/base/interval_set.h" 11 #include "net/base/interval_set.h"
12 #include "net/base/linked_hash_map.h" 12 #include "net/base/linked_hash_map.h"
13 13
14 namespace net { 14 namespace net {
15 15
16 // A map which offers insertion-ordered iteration. 16 // A map which offers insertion-ordered iteration.
17 template <typename Key, typename Value> 17 template <typename Key, typename Value>
18 using QuicLinkedHashMapImpl = linked_hash_map<Key, Value>; 18 using QuicLinkedHashMapImpl = linked_hash_map<Key, Value>;
19 19
20 // A map which is faster than (for example) hash_map for a certain number of 20 // A map which is faster than (for example) hash_map for a certain number of
21 // unique key-value-pair elements, and upgrades itself to unordered_map when 21 // unique key-value-pair elements, and upgrades itself to unordered_map when
22 // runs out of space. 22 // runs out of space.
23 template <typename Key, typename Value, int Size> 23 template <typename Key, typename Value, int Size>
24 using QuicSmallMapImpl = base::SmallMap<std::unordered_map<Key, Value>, Size>; 24 using QuicSmallMapImpl = base::small_map<std::unordered_map<Key, Value>, Size>;
25 25
26 // A data structure used to represent a sorted set of non-empty, non-adjacent, 26 // A data structure used to represent a sorted set of non-empty, non-adjacent,
27 // and mutually disjoint intervals. 27 // and mutually disjoint intervals.
28 template <typename T> 28 template <typename T>
29 using QuicIntervalSetImpl = IntervalSet<T>; 29 using QuicIntervalSetImpl = IntervalSet<T>;
30 30
31 } // namespace net 31 } // namespace net
32 32
33 #endif // NET_QUIC_PLATFORM_IMPL_QUIC_CONTAINERS_IMPL_H_ 33 #endif // NET_QUIC_PLATFORM_IMPL_QUIC_CONTAINERS_IMPL_H_
OLDNEW
« no previous file with comments | « ipc/ipc_message_utils_unittest.cc ('k') | storage/browser/blob/blob_memory_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698