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

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

Issue 1046523002: Cache the value of GetMaxPlaintextSize in QuicPacketCreator. No functional change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | 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 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after
1732 if (!HasQueuedData() && !retransmission_alarm_->IsSet()) { 1732 if (!HasQueuedData() && !retransmission_alarm_->IsSet()) {
1733 QuicTime rto_timeout = sent_packet_manager_.GetRetransmissionTime(); 1733 QuicTime rto_timeout = sent_packet_manager_.GetRetransmissionTime();
1734 if (rto_timeout.IsInitialized()) { 1734 if (rto_timeout.IsInitialized()) {
1735 retransmission_alarm_->Set(rto_timeout); 1735 retransmission_alarm_->Set(rto_timeout);
1736 } 1736 }
1737 } 1737 }
1738 } 1738 }
1739 1739
1740 void QuicConnection::SetEncrypter(EncryptionLevel level, 1740 void QuicConnection::SetEncrypter(EncryptionLevel level,
1741 QuicEncrypter* encrypter) { 1741 QuicEncrypter* encrypter) {
1742 framer_.SetEncrypter(level, encrypter); 1742 packet_generator_.SetEncrypter(level, encrypter);
1743 if (level == ENCRYPTION_FORWARD_SECURE) { 1743 if (level == ENCRYPTION_FORWARD_SECURE) {
1744 has_forward_secure_encrypter_ = true; 1744 has_forward_secure_encrypter_ = true;
1745 first_required_forward_secure_packet_ = 1745 first_required_forward_secure_packet_ =
1746 sequence_number_of_last_sent_packet_ + 1746 sequence_number_of_last_sent_packet_ +
1747 // 3 times the current congestion window (in slow start) should cover 1747 // 3 times the current congestion window (in slow start) should cover
1748 // about two full round trips worth of packets, which should be 1748 // about two full round trips worth of packets, which should be
1749 // sufficient. 1749 // sufficient.
1750 3 * sent_packet_manager_.EstimateMaxPacketsInFlight( 1750 3 * sent_packet_manager_.EstimateMaxPacketsInFlight(
1751 max_packet_length()); 1751 max_packet_length());
1752 } 1752 }
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
2139 } 2139 }
2140 for (const QuicFrame& frame : retransmittable_frames->frames()) { 2140 for (const QuicFrame& frame : retransmittable_frames->frames()) {
2141 if (frame.type == CONNECTION_CLOSE_FRAME) { 2141 if (frame.type == CONNECTION_CLOSE_FRAME) {
2142 return true; 2142 return true;
2143 } 2143 }
2144 } 2144 }
2145 return false; 2145 return false;
2146 } 2146 }
2147 2147
2148 } // namespace net 2148 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698