OLD | NEW |
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 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1577 first_required_forward_secure_packet_) { | 1577 first_required_forward_secure_packet_) { |
1578 SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE); | 1578 SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE); |
1579 } | 1579 } |
1580 if (serialized_packet.retransmittable_frames) { | 1580 if (serialized_packet.retransmittable_frames) { |
1581 serialized_packet.retransmittable_frames-> | 1581 serialized_packet.retransmittable_frames-> |
1582 set_encryption_level(encryption_level_); | 1582 set_encryption_level(encryption_level_); |
1583 } | 1583 } |
1584 SendOrQueuePacket(QueuedPacket(serialized_packet, encryption_level_)); | 1584 SendOrQueuePacket(QueuedPacket(serialized_packet, encryption_level_)); |
1585 } | 1585 } |
1586 | 1586 |
1587 void QuicConnection::OnCongestionWindowChange(QuicByteCount congestion_window) { | 1587 void QuicConnection::OnCongestionWindowChange() { |
1588 packet_generator_.OnCongestionWindowChange(congestion_window); | 1588 packet_generator_.OnCongestionWindowChange( |
| 1589 sent_packet_manager_.GetCongestionWindow()); |
1589 visitor_->OnCongestionWindowChange(clock_->ApproximateNow()); | 1590 visitor_->OnCongestionWindowChange(clock_->ApproximateNow()); |
1590 } | 1591 } |
1591 | 1592 |
1592 void QuicConnection::OnHandshakeComplete() { | 1593 void QuicConnection::OnHandshakeComplete() { |
1593 sent_packet_manager_.SetHandshakeConfirmed(); | 1594 sent_packet_manager_.SetHandshakeConfirmed(); |
1594 } | 1595 } |
1595 | 1596 |
1596 void QuicConnection::SendOrQueuePacket(QueuedPacket packet) { | 1597 void QuicConnection::SendOrQueuePacket(QueuedPacket packet) { |
1597 // The caller of this function is responsible for checking CanWrite(). | 1598 // The caller of this function is responsible for checking CanWrite(). |
1598 if (packet.serialized_packet.packet == nullptr) { | 1599 if (packet.serialized_packet.packet == nullptr) { |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2107 } | 2108 } |
2108 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) { | 2109 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) { |
2109 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) { | 2110 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) { |
2110 return true; | 2111 return true; |
2111 } | 2112 } |
2112 } | 2113 } |
2113 return false; | 2114 return false; |
2114 } | 2115 } |
2115 | 2116 |
2116 } // namespace net | 2117 } // namespace net |
OLD | NEW |