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

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

Issue 694383002: Tiny refactor of QuicSentPacketManager::NetworkChangeVisitor's (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Change_number_of_emulated_connections_78876869
Patch Set: Created 6 years, 1 month 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_connection.h ('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 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698