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

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

Issue 1037403004: Land Recent QUIC Changes until 03/27/2015 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 5 years, 9 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 | « 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 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 }
1753 } 1753 }
1754 1754
1755 const QuicEncrypter* QuicConnection::encrypter(EncryptionLevel level) const {
1756 return framer_.encrypter(level);
1757 }
1758
1759 void QuicConnection::SetDefaultEncryptionLevel(EncryptionLevel level) { 1755 void QuicConnection::SetDefaultEncryptionLevel(EncryptionLevel level) {
1760 encryption_level_ = level; 1756 encryption_level_ = level;
1761 packet_generator_.set_encryption_level(level); 1757 packet_generator_.set_encryption_level(level);
1762 } 1758 }
1763 1759
1764 void QuicConnection::SetDecrypter(QuicDecrypter* decrypter, 1760 void QuicConnection::SetDecrypter(QuicDecrypter* decrypter,
1765 EncryptionLevel level) { 1761 EncryptionLevel level) {
1766 framer_.SetDecrypter(decrypter, level); 1762 framer_.SetDecrypter(decrypter, level);
1767 } 1763 }
1768 1764
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
2143 } 2139 }
2144 for (const QuicFrame& frame : retransmittable_frames->frames()) { 2140 for (const QuicFrame& frame : retransmittable_frames->frames()) {
2145 if (frame.type == CONNECTION_CLOSE_FRAME) { 2141 if (frame.type == CONNECTION_CLOSE_FRAME) {
2146 return true; 2142 return true;
2147 } 2143 }
2148 } 2144 }
2149 return false; 2145 return false;
2150 } 2146 }
2151 2147
2152 } // namespace net 2148 } // 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