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

Unified Diff: net/base/linked_hash_map.h

Issue 1013583002: Make the SentPacketManager remove pending retransmissions for reset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Replace_CID_with_connection_id_88463135
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/quic/quic_sent_packet_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/linked_hash_map.h
diff --git a/net/base/linked_hash_map.h b/net/base/linked_hash_map.h
index b024ca1d5361d46f958051b096d668b61412ce6c..cdfb971cc30182025175d471556a2a29f2159655 100644
--- a/net/base/linked_hash_map.h
+++ b/net/base/linked_hash_map.h
@@ -124,23 +124,28 @@ class linked_hash_map {
return 1;
}
- // Erases values with the provided iterator. If the provided iterator is
- // invalid or there is inconsistency between the map and list, a CHECK() error
- // will occur.
- void erase(iterator position) {
+ // Erases the item that 'position' points to. Returns an iterator that points
+ // to the item that comes immediately after the deleted item in the list, or
+ // end().
+ // If the provided iterator is invalid or there is inconsistency between the
+ // map and list, a CHECK() error will occur.
+ iterator erase(iterator position) {
typename MapType::iterator found = map_.find(position->first);
CHECK(found->second == position)
<< "Inconsisent iterator for map and list, or the iterator is invalid.";
- list_.erase(position);
map_.erase(found);
+ return list_.erase(position);
}
- // Erases values between first and last, not including last.
- void erase(iterator first, iterator last) {
+ // Erases all the items in the range [first, last). Returns an iterator that
+ // points to the item that comes immediately after the last deleted item in
+ // the list, or end().
+ iterator erase(iterator first, iterator last) {
while (first != last && first != end()) {
- erase(first++);
+ first = erase(first);
}
+ return first;
}
// Finds the element with the given key. Returns an iterator to the
« no previous file with comments | « no previous file | net/quic/quic_sent_packet_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698