OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 5 #ifndef NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
6 #define NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 6 #define NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 }; | 60 }; |
61 | 61 |
62 // Interface which gets callbacks from the QuicSentPacketManager when | 62 // Interface which gets callbacks from the QuicSentPacketManager when |
63 // network-related state changes. Implementations must not mutate the | 63 // network-related state changes. Implementations must not mutate the |
64 // state of the packet manager as a result of these callbacks. | 64 // state of the packet manager as a result of these callbacks. |
65 class NET_EXPORT_PRIVATE NetworkChangeVisitor { | 65 class NET_EXPORT_PRIVATE NetworkChangeVisitor { |
66 public: | 66 public: |
67 virtual ~NetworkChangeVisitor() {} | 67 virtual ~NetworkChangeVisitor() {} |
68 | 68 |
69 // Called when congestion window may have changed. | 69 // Called when congestion window may have changed. |
70 virtual void OnCongestionWindowChange(QuicByteCount congestion_window) = 0; | 70 virtual void OnCongestionWindowChange() = 0; |
71 // TODO(jri): Add OnRttStatsChange() to this class as well. | 71 // TODO(jri): Add OnRttStatsChange() to this class as well. |
72 }; | 72 }; |
73 | 73 |
74 // Struct to store the pending retransmission information. | 74 // Struct to store the pending retransmission information. |
75 struct PendingRetransmission { | 75 struct PendingRetransmission { |
76 PendingRetransmission(QuicPacketSequenceNumber sequence_number, | 76 PendingRetransmission(QuicPacketSequenceNumber sequence_number, |
77 TransmissionType transmission_type, | 77 TransmissionType transmission_type, |
78 const RetransmittableFrames& retransmittable_frames, | 78 const RetransmittableFrames& retransmittable_frames, |
79 QuicSequenceNumberLength sequence_number_length) | 79 QuicSequenceNumberLength sequence_number_length) |
80 : sequence_number(sequence_number), | 80 : sequence_number(sequence_number), |
(...skipping 10 matching lines...) Expand all Loading... |
91 | 91 |
92 QuicSentPacketManager(bool is_server, | 92 QuicSentPacketManager(bool is_server, |
93 const QuicClock* clock, | 93 const QuicClock* clock, |
94 QuicConnectionStats* stats, | 94 QuicConnectionStats* stats, |
95 CongestionControlType congestion_control_type, | 95 CongestionControlType congestion_control_type, |
96 LossDetectionType loss_type); | 96 LossDetectionType loss_type); |
97 virtual ~QuicSentPacketManager(); | 97 virtual ~QuicSentPacketManager(); |
98 | 98 |
99 virtual void SetFromConfig(const QuicConfig& config); | 99 virtual void SetFromConfig(const QuicConfig& config); |
100 | 100 |
| 101 void SetNumOpenStreams(size_t num_streams); |
| 102 |
101 void SetHandshakeConfirmed() { handshake_confirmed_ = true; } | 103 void SetHandshakeConfirmed() { handshake_confirmed_ = true; } |
102 | 104 |
103 // Processes the incoming ack. | 105 // Processes the incoming ack. |
104 void OnIncomingAck(const QuicAckFrame& ack_frame, | 106 void OnIncomingAck(const QuicAckFrame& ack_frame, |
105 QuicTime ack_receive_time); | 107 QuicTime ack_receive_time); |
106 | 108 |
107 // Returns true if the non-FEC packet |sequence_number| is unacked. | 109 // Returns true if the non-FEC packet |sequence_number| is unacked. |
108 bool IsUnacked(QuicPacketSequenceNumber sequence_number) const; | 110 bool IsUnacked(QuicPacketSequenceNumber sequence_number) const; |
109 | 111 |
110 // Requests retransmission of all unacked packets of |retransmission_type|. | 112 // Requests retransmission of all unacked packets of |retransmission_type|. |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 // maintains the currently active notifiers. | 340 // maintains the currently active notifiers. |
339 AckNotifierManager ack_notifier_manager_; | 341 AckNotifierManager ack_notifier_manager_; |
340 | 342 |
341 const QuicClock* clock_; | 343 const QuicClock* clock_; |
342 QuicConnectionStats* stats_; | 344 QuicConnectionStats* stats_; |
343 DebugDelegate* debug_delegate_; | 345 DebugDelegate* debug_delegate_; |
344 NetworkChangeVisitor* network_change_visitor_; | 346 NetworkChangeVisitor* network_change_visitor_; |
345 RttStats rtt_stats_; | 347 RttStats rtt_stats_; |
346 scoped_ptr<SendAlgorithmInterface> send_algorithm_; | 348 scoped_ptr<SendAlgorithmInterface> send_algorithm_; |
347 scoped_ptr<LossDetectionInterface> loss_algorithm_; | 349 scoped_ptr<LossDetectionInterface> loss_algorithm_; |
| 350 bool n_connection_simulation_; |
348 | 351 |
349 // Receiver side buffer in bytes. | 352 // Receiver side buffer in bytes. |
350 QuicByteCount receive_buffer_bytes_; | 353 QuicByteCount receive_buffer_bytes_; |
351 | 354 |
352 // Least sequence number which the peer is still waiting for. | 355 // Least sequence number which the peer is still waiting for. |
353 QuicPacketSequenceNumber least_packet_awaited_by_peer_; | 356 QuicPacketSequenceNumber least_packet_awaited_by_peer_; |
354 | 357 |
355 // Tracks the first RTO packet. If any packet before that packet gets acked, | 358 // Tracks the first RTO packet. If any packet before that packet gets acked, |
356 // it indicates the RTO was spurious and should be reversed(F-RTO). | 359 // it indicates the RTO was spurious and should be reversed(F-RTO). |
357 QuicPacketSequenceNumber first_rto_transmission_; | 360 QuicPacketSequenceNumber first_rto_transmission_; |
(...skipping 22 matching lines...) Expand all Loading... |
380 // Records bandwidth from server to client in normal operation, over periods | 383 // Records bandwidth from server to client in normal operation, over periods |
381 // of time with no loss events. | 384 // of time with no loss events. |
382 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; | 385 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; |
383 | 386 |
384 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); | 387 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); |
385 }; | 388 }; |
386 | 389 |
387 } // namespace net | 390 } // namespace net |
388 | 391 |
389 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 392 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
OLD | NEW |