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

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

Issue 968233004: Land Recent QUIC Changes until 03/02/2015. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: 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_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 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // This will likely have to be tuned. 54 // This will likely have to be tuned.
55 const QuicPacketSequenceNumber kMaxPacketGap = 5000; 55 const QuicPacketSequenceNumber kMaxPacketGap = 5000;
56 56
57 // Limit the number of FEC groups to two. If we get enough out of order packets 57 // Limit the number of FEC groups to two. If we get enough out of order packets
58 // that this becomes limiting, we can revisit. 58 // that this becomes limiting, we can revisit.
59 const size_t kMaxFecGroups = 2; 59 const size_t kMaxFecGroups = 2;
60 60
61 // Maximum number of acks received before sending an ack in response. 61 // Maximum number of acks received before sending an ack in response.
62 const QuicPacketCount kMaxPacketsReceivedBeforeAckSend = 20; 62 const QuicPacketCount kMaxPacketsReceivedBeforeAckSend = 20;
63 63
64 // Maximum number of tracked packets.
65 const QuicPacketCount kMaxTrackedPackets = 5 * kMaxTcpCongestionWindow;
66
67 bool Near(QuicPacketSequenceNumber a, QuicPacketSequenceNumber b) { 64 bool Near(QuicPacketSequenceNumber a, QuicPacketSequenceNumber b) {
68 QuicPacketSequenceNumber delta = (a > b) ? a - b : b - a; 65 QuicPacketSequenceNumber delta = (a > b) ? a - b : b - a;
69 return delta <= kMaxPacketGap; 66 return delta <= kMaxPacketGap;
70 } 67 }
71 68
72 // An alarm that is scheduled to send an ack if a timeout occurs. 69 // An alarm that is scheduled to send an ack if a timeout occurs.
73 class AckAlarm : public QuicAlarm::Delegate { 70 class AckAlarm : public QuicAlarm::Delegate {
74 public: 71 public:
75 explicit AckAlarm(QuicConnection* connection) 72 explicit AckAlarm(QuicConnection* connection)
76 : connection_(connection) { 73 : connection_(connection) {
(...skipping 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after
2082 } 2079 }
2083 for (const QuicFrame& frame : retransmittable_frames->frames()) { 2080 for (const QuicFrame& frame : retransmittable_frames->frames()) {
2084 if (frame.type == CONNECTION_CLOSE_FRAME) { 2081 if (frame.type == CONNECTION_CLOSE_FRAME) {
2085 return true; 2082 return true;
2086 } 2083 }
2087 } 2084 }
2088 return false; 2085 return false;
2089 } 2086 }
2090 2087
2091 } // namespace net 2088 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_config.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698