| OLD | NEW |
| 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 #ifndef NET_QUIC_QUIC_MULTIPATH_SENT_PACKET_MANAGER_H_ | 5 #ifndef NET_QUIC_QUIC_MULTIPATH_SENT_PACKET_MANAGER_H_ |
| 6 #define NET_QUIC_QUIC_MULTIPATH_SENT_PACKET_MANAGER_H_ | 6 #define NET_QUIC_QUIC_MULTIPATH_SENT_PACKET_MANAGER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
| 11 #include "net/quic/core/quic_connection_close_delegate_interface.h" | 11 #include "net/quic/core/quic_connection_close_delegate_interface.h" |
| 12 #include "net/quic/core/quic_protocol.h" | 12 #include "net/quic/core/quic_packets.h" |
| 13 #include "net/quic/core/quic_sent_packet_manager.h" | 13 #include "net/quic/core/quic_sent_packet_manager.h" |
| 14 #include "net/quic/core/quic_sent_packet_manager_interface.h" | 14 #include "net/quic/core/quic_sent_packet_manager_interface.h" |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 | 17 |
| 18 namespace test { | 18 namespace test { |
| 19 class QuicConnectionPeer; | 19 class QuicConnectionPeer; |
| 20 class QuicMultipathSentPacketManagerPeer; | 20 class QuicMultipathSentPacketManagerPeer; |
| 21 } // namespace test | 21 } // namespace test |
| 22 | 22 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 // Removes the retransmittable frames from all unencrypted packets on the | 68 // Removes the retransmittable frames from all unencrypted packets on the |
| 69 // default path to ensure they don't get retransmitted. | 69 // default path to ensure they don't get retransmitted. |
| 70 void NeuterUnencryptedPackets() override; | 70 void NeuterUnencryptedPackets() override; |
| 71 | 71 |
| 72 // Returns true if there are pending retransmissions. | 72 // Returns true if there are pending retransmissions. |
| 73 bool HasPendingRetransmissions() const override; | 73 bool HasPendingRetransmissions() const override; |
| 74 | 74 |
| 75 // Retrieves the next pending retransmission. Caller must ensure that | 75 // Retrieves the next pending retransmission. Caller must ensure that |
| 76 // there are pending retransmissions prior to calling this function. | 76 // there are pending retransmissions prior to calling this function. |
| 77 PendingRetransmission NextPendingRetransmission() override; | 77 QuicPendingRetransmission NextPendingRetransmission() override; |
| 78 | 78 |
| 79 // Returns true if the any path has unacked packets. | 79 // Returns true if the any path has unacked packets. |
| 80 bool HasUnackedPackets() const override; | 80 bool HasUnackedPackets() const override; |
| 81 | 81 |
| 82 // Returns the smallest packet number of a serialized packet which has not | 82 // Returns the smallest packet number of a serialized packet which has not |
| 83 // been acked on |path_id|. | 83 // been acked on |path_id|. |
| 84 QuicPacketNumber GetLeastUnacked(QuicPathId path_id) const override; | 84 QuicPacketNumber GetLeastUnacked(QuicPathId path_id) const override; |
| 85 | 85 |
| 86 // Called when a packet has been sent to the peer. If this packet is a | 86 // Called when a packet has been sent to the peer. If this packet is a |
| 87 // retransmission on a different path than the original packet, records the | 87 // retransmission on a different path than the original packet, records the |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // Returns true if the default path is in slow start. | 160 // Returns true if the default path is in slow start. |
| 161 bool InSlowStart() const override; | 161 bool InSlowStart() const override; |
| 162 | 162 |
| 163 // These two methods return the consecutive RTO or TLP count of the default | 163 // These two methods return the consecutive RTO or TLP count of the default |
| 164 // path. | 164 // path. |
| 165 size_t GetConsecutiveRtoCount() const override; | 165 size_t GetConsecutiveRtoCount() const override; |
| 166 size_t GetConsecutiveTlpCount() const override; | 166 size_t GetConsecutiveTlpCount() const override; |
| 167 | 167 |
| 168 void OnApplicationLimited() override; | 168 void OnApplicationLimited() override; |
| 169 | 169 |
| 170 const SendAlgorithmInterface* GetSendAlgorithm() const override; |
| 171 |
| 170 private: | 172 private: |
| 171 friend class test::QuicConnectionPeer; | 173 friend class test::QuicConnectionPeer; |
| 172 friend class test::QuicMultipathSentPacketManagerPeer; | 174 friend class test::QuicMultipathSentPacketManagerPeer; |
| 173 | 175 |
| 174 // State of per path sent packet manager. | 176 // State of per path sent packet manager. |
| 175 // TODO(fayang): Need to add a state that path can receive acks but cannot | 177 // TODO(fayang): Need to add a state that path can receive acks but cannot |
| 176 // send data. | 178 // send data. |
| 177 enum PathSentPacketManagerState { | 179 enum PathSentPacketManagerState { |
| 178 ACTIVE, // We both send packets and receiving acks on this path. | 180 ACTIVE, // We both send packets and receiving acks on this path. |
| 179 CLOSING, // We stop sending packets and receiving acks on this path. There | 181 CLOSING, // We stop sending packets and receiving acks on this path. There |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 214 |
| 213 // Does not own this delegate. | 215 // Does not own this delegate. |
| 214 QuicConnectionCloseDelegateInterface* delegate_; | 216 QuicConnectionCloseDelegateInterface* delegate_; |
| 215 | 217 |
| 216 DISALLOW_COPY_AND_ASSIGN(QuicMultipathSentPacketManager); | 218 DISALLOW_COPY_AND_ASSIGN(QuicMultipathSentPacketManager); |
| 217 }; | 219 }; |
| 218 | 220 |
| 219 } // namespace net | 221 } // namespace net |
| 220 | 222 |
| 221 #endif // NET_QUIC_QUIC_MULTIPATH_SENT_PACKET_MANAGER_H_ | 223 #endif // NET_QUIC_QUIC_MULTIPATH_SENT_PACKET_MANAGER_H_ |
| OLD | NEW |