OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // This is a simplistic insertion-ordered map. It behaves similarly to an STL | 5 // This is a simplistic insertion-ordered map. It behaves similarly to an STL |
6 // map, but only implements a small subset of the map's methods. Internally, we | 6 // map, but only implements a small subset of the map's methods. Internally, we |
7 // just keep a map and a list going in parallel. | 7 // just keep a map and a list going in parallel. |
8 // | 8 // |
9 // This class provides no thread safety guarantees, beyond what you would | 9 // This class provides no thread safety guarantees, beyond what you would |
10 // normally see with std::list. | 10 // normally see with std::list. |
11 // | 11 // |
12 // Iterators should be stable in the face of mutations, except for an | 12 // Iterators should be stable in the face of mutations, except for an |
13 // iterator pointing to an element that was just deleted. | 13 // iterator pointing to an element that was just deleted. |
14 | 14 |
15 #ifndef UTIL_GTL_LINKED_HASH_MAP_H_ | 15 #ifndef NET_BASE_LINKED_HASH_MAP_H_ |
16 #define UTIL_GTL_LINKED_HASH_MAP_H_ | 16 #define NET_BASE_LINKED_HASH_MAP_H_ |
17 | 17 |
18 #include <stddef.h> | 18 #include <stddef.h> |
19 | 19 |
20 #include <list> | 20 #include <list> |
21 #include <unordered_map> | 21 #include <unordered_map> |
22 #include <utility> | 22 #include <utility> |
23 | 23 |
24 #include "base/logging.h" | 24 #include "base/logging.h" |
25 #include "base/macros.h" | 25 #include "base/macros.h" |
26 | 26 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 // The list component, used for maintaining insertion order | 254 // The list component, used for maintaining insertion order |
255 ListType list_; | 255 ListType list_; |
256 | 256 |
257 // |map_| contains iterators to |list_|, therefore a default copy constructor | 257 // |map_| contains iterators to |list_|, therefore a default copy constructor |
258 // or copy assignment operator would result in an inconsistent state. | 258 // or copy assignment operator would result in an inconsistent state. |
259 DISALLOW_COPY_AND_ASSIGN(linked_hash_map); | 259 DISALLOW_COPY_AND_ASSIGN(linked_hash_map); |
260 }; | 260 }; |
261 | 261 |
262 } // namespace net | 262 } // namespace net |
263 | 263 |
264 #endif // UTIL_GTL_LINKED_HASH_MAP_H_ | 264 #endif // NET_BASE_LINKED_HASH_MAP_H_ |
OLD | NEW |