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

Unified Diff: net/quic/quic_unacked_packet_map.cc

Issue 188273003: QUIC refactor to move the pending_crypto_packet_count_ from the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_unacked_packet_map.h ('k') | net/quic/test_tools/quic_sent_packet_manager_peer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_unacked_packet_map.cc
diff --git a/net/quic/quic_unacked_packet_map.cc b/net/quic/quic_unacked_packet_map.cc
index 2a978f41af8913c1ab17347816ceafbd255a70d1..b89d73b98bbfcbad5100abe1eaf286cd3f1b76d8 100644
--- a/net/quic/quic_unacked_packet_map.cc
+++ b/net/quic/quic_unacked_packet_map.cc
@@ -53,7 +53,8 @@ QuicUnackedPacketMap::TransmissionInfo::TransmissionInfo(
QuicUnackedPacketMap::QuicUnackedPacketMap()
: largest_sent_packet_(0),
- bytes_in_flight_(0) {
+ bytes_in_flight_(0),
+ pending_crypto_packet_count_(0) {
}
QuicUnackedPacketMap::~QuicUnackedPacketMap() {
@@ -84,6 +85,11 @@ void QuicUnackedPacketMap::AddPacket(
TransmissionInfo(serialized_packet.retransmittable_frames,
serialized_packet.sequence_number,
serialized_packet.sequence_number_length);
+ if (serialized_packet.retransmittable_frames != NULL &&
+ serialized_packet.retransmittable_frames->HasCryptoHandshake()
+ == IS_HANDSHAKE) {
+ ++pending_crypto_packet_count_;
+ }
}
void QuicUnackedPacketMap::OnRetransmittedPacket(
@@ -164,6 +170,10 @@ void QuicUnackedPacketMap::RemovePacket(
delete transmission_info.all_transmissions;
}
if (transmission_info.retransmittable_frames != NULL) {
+ if (transmission_info.retransmittable_frames->HasCryptoHandshake()
+ == IS_HANDSHAKE) {
+ --pending_crypto_packet_count_;
+ }
delete transmission_info.retransmittable_frames;
}
unacked_packets_.erase(it);
@@ -279,6 +289,10 @@ bool QuicUnackedPacketMap::HasMultiplePendingPackets() const {
return false;
}
+bool QuicUnackedPacketMap::HasPendingCryptoPackets() const {
+ return pending_crypto_packet_count_ > 0;
+}
+
bool QuicUnackedPacketMap::HasUnackedRetransmittableFrames() const {
for (UnackedPacketMap::const_reverse_iterator it =
unacked_packets_.rbegin(); it != unacked_packets_.rend(); ++it) {
« no previous file with comments | « net/quic/quic_unacked_packet_map.h ('k') | net/quic/test_tools/quic_sent_packet_manager_peer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698