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

Side by Side Diff: net/quic/quic_packet_creator.cc

Issue 1663703003: use std::unordered_map and std::unordered_set in QUIC code instead of (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@113259990
Patch Set: rebase 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/quic/quic_packet_creator.h ('k') | net/quic/quic_session.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 #include "net/quic/quic_packet_creator.h" 5 #include "net/quic/quic_packet_creator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 if (HasPendingFrames()) { 842 if (HasPendingFrames()) {
843 QUIC_BUG << "Unable to change paths when a packet is under construction."; 843 QUIC_BUG << "Unable to change paths when a packet is under construction.";
844 return; 844 return;
845 } 845 }
846 846
847 // Send FEC packet and close FEC group. 847 // Send FEC packet and close FEC group.
848 MaybeSendFecPacketAndCloseGroup(/*force_send_fec=*/true, 848 MaybeSendFecPacketAndCloseGroup(/*force_send_fec=*/true,
849 /*is_fec_timeout=*/false); 849 /*is_fec_timeout=*/false);
850 // Save current packet number and load switching path's packet number. 850 // Save current packet number and load switching path's packet number.
851 multipath_packet_number_[packet_.path_id] = packet_.packet_number; 851 multipath_packet_number_[packet_.path_id] = packet_.packet_number;
852 hash_map<QuicPathId, QuicPacketNumber>::iterator it = 852 std::unordered_map<QuicPathId, QuicPacketNumber>::iterator it =
853 multipath_packet_number_.find(path_id); 853 multipath_packet_number_.find(path_id);
854 // If path_id is not in the map, it's a new path. Set packet_number to 0. 854 // If path_id is not in the map, it's a new path. Set packet_number to 0.
855 packet_.packet_number = it == multipath_packet_number_.end() ? 0 : it->second; 855 packet_.packet_number = it == multipath_packet_number_.end() ? 0 : it->second;
856 packet_.path_id = path_id; 856 packet_.path_id = path_id;
857 DCHECK(packet_.path_id != kInvalidPathId); 857 DCHECK(packet_.path_id != kInvalidPathId);
858 // Send path in packet if current path is not the default path. 858 // Send path in packet if current path is not the default path.
859 send_path_id_in_packet_ = packet_.path_id != kDefaultPathId ? true : false; 859 send_path_id_in_packet_ = packet_.path_id != kDefaultPathId ? true : false;
860 // Switching path needs to update packet number length. 860 // Switching path needs to update packet number length.
861 UpdatePacketNumberLength(least_packet_awaited_by_peer, max_packets_in_flight); 861 UpdatePacketNumberLength(least_packet_awaited_by_peer, max_packets_in_flight);
862 } 862 }
863 863
864 } // namespace net 864 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_packet_creator.h ('k') | net/quic/quic_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698