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

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

Issue 327393002: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/crypto/quic_crypto_server_config.cc ('k') | net/quic/quic_connection_test.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) 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_connection.h" 5 #include "net/quic/quic_connection.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 #include <sys/types.h> 8 #include <sys/types.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <iterator> 10 #include <iterator>
(...skipping 1585 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 packet_generator_.SetShouldSendAck(send_feedback, 1596 packet_generator_.SetShouldSendAck(send_feedback,
1597 version() > QUIC_VERSION_15); 1597 version() > QUIC_VERSION_15);
1598 } 1598 }
1599 1599
1600 void QuicConnection::OnRetransmissionTimeout() { 1600 void QuicConnection::OnRetransmissionTimeout() {
1601 if (!sent_packet_manager_.HasUnackedPackets()) { 1601 if (!sent_packet_manager_.HasUnackedPackets()) {
1602 return; 1602 return;
1603 } 1603 }
1604 1604
1605 sent_packet_manager_.OnRetransmissionTimeout(); 1605 sent_packet_manager_.OnRetransmissionTimeout();
1606 WriteIfNotBlocked();
1607 // In the TLP case, the SentPacketManager gives the connection the opportunity
1608 // to send new data before retransmitting.
1609 if (sent_packet_manager_.MaybeRetransmitTailLossProbe()) {
1610 // Send the pending retransmission now that it's been queued.
1611 WriteIfNotBlocked();
1612 }
1606 1613
1607 WriteIfNotBlocked(); 1614 // Ensure the retransmission alarm is always set if there are unacked packets
1608 1615 // and nothing waiting to be sent.
1609 // Ensure the retransmission alarm is always set if there are unacked packets.
1610 if (!HasQueuedData() && !retransmission_alarm_->IsSet()) { 1616 if (!HasQueuedData() && !retransmission_alarm_->IsSet()) {
1611 QuicTime rto_timeout = sent_packet_manager_.GetRetransmissionTime(); 1617 QuicTime rto_timeout = sent_packet_manager_.GetRetransmissionTime();
1612 if (rto_timeout != QuicTime::Zero()) { 1618 if (rto_timeout != QuicTime::Zero()) {
1613 retransmission_alarm_->Set(rto_timeout); 1619 retransmission_alarm_->Set(rto_timeout);
1614 } 1620 }
1615 } 1621 }
1616 } 1622 }
1617 1623
1618 void QuicConnection::SetEncrypter(EncryptionLevel level, 1624 void QuicConnection::SetEncrypter(EncryptionLevel level,
1619 QuicEncrypter* encrypter) { 1625 QuicEncrypter* encrypter) {
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1956 // If we changed the generator's batch state, restore original batch state. 1962 // If we changed the generator's batch state, restore original batch state.
1957 if (!already_in_batch_mode_) { 1963 if (!already_in_batch_mode_) {
1958 DVLOG(1) << "Leaving Batch Mode."; 1964 DVLOG(1) << "Leaving Batch Mode.";
1959 connection_->packet_generator_.FinishBatchOperations(); 1965 connection_->packet_generator_.FinishBatchOperations();
1960 } 1966 }
1961 DCHECK_EQ(already_in_batch_mode_, 1967 DCHECK_EQ(already_in_batch_mode_,
1962 connection_->packet_generator_.InBatchMode()); 1968 connection_->packet_generator_.InBatchMode());
1963 } 1969 }
1964 1970
1965 } // namespace net 1971 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/quic_crypto_server_config.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698