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

Side by Side Diff: net/base/linked_hash_map.h

Issue 469383004: Re-add the QUIC DCHECK to ensure packets are always sent in the order of (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@optimize_HasCryptoHandshake_73125935
Patch Set: Created 6 years, 4 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 | « no previous file | net/quic/congestion_control/tcp_cubic_sender.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) 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.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } 72 }
73 73
74 // Returns an iterator beyond the first element. 74 // Returns an iterator beyond the first element.
75 reverse_iterator rend() { 75 reverse_iterator rend() {
76 return list_.rend(); 76 return list_.rend();
77 } 77 }
78 const_reverse_iterator rend() const { 78 const_reverse_iterator rend() const {
79 return list_.rend(); 79 return list_.rend();
80 } 80 }
81 81
82 // Front and back accessors common to many stl containers.
83
84 // Returns the earliest-inserted element
85 const value_type& front() const {
ramant (doing other things) 2014/08/15 01:51:33 We are only using back(), added front() to be cons
86 return list_.front();
87 }
88
89 // Returns the earliest-inserted element.
90 value_type& front() {
91 return list_.front();
92 }
93
94 // Returns the most-recently-inserted element.
95 const value_type& back() const {
96 return list_.back();
97 }
98
99 // Returns the most-recently-inserted element.
100 value_type& back() {
101 return list_.back();
102 }
103
82 // Clears the map of all values. 104 // Clears the map of all values.
83 void clear() { 105 void clear() {
84 map_.clear(); 106 map_.clear();
85 list_.clear(); 107 list_.clear();
86 } 108 }
87 109
88 // Returns true iff the map is empty. 110 // Returns true iff the map is empty.
89 bool empty() const { 111 bool empty() const {
90 return list_.empty(); 112 return list_.empty();
91 } 113 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 223
202 private: 224 private:
203 // The map component, used for speedy lookups 225 // The map component, used for speedy lookups
204 MapType map_; 226 MapType map_;
205 227
206 // The list component, used for maintaining insertion order 228 // The list component, used for maintaining insertion order
207 ListType list_; 229 ListType list_;
208 }; 230 };
209 231
210 #endif // UTIL_GTL_LINKED_HASH_MAP_H_ 232 #endif // UTIL_GTL_LINKED_HASH_MAP_H_
OLDNEW
« no previous file with comments | « no previous file | net/quic/congestion_control/tcp_cubic_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698