| 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 // Responsible for generating packets on behalf of a QuicConnection. | 5 // Responsible for generating packets on behalf of a QuicConnection. |
| 6 // Packets are serialized just-in-time. Control frames are queued. | 6 // Packets are serialized just-in-time. Control frames are queued. |
| 7 // Ack and Feedback frames will be requested from the Connection | 7 // Ack and Feedback frames will be requested from the Connection |
| 8 // just-in-time. When a packet needs to be sent, the Generator | 8 // just-in-time. When a packet needs to be sent, the Generator |
| 9 // will serialize a packet and pass it to QuicConnection::SendOrQueuePacket() | 9 // will serialize a packet and pass it to QuicConnection::SendOrQueuePacket() |
| 10 // | 10 // |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #define NET_QUIC_QUIC_PACKET_GENERATOR_H_ | 41 #define NET_QUIC_QUIC_PACKET_GENERATOR_H_ |
| 42 | 42 |
| 43 #include <stddef.h> | 43 #include <stddef.h> |
| 44 #include <stdint.h> | 44 #include <stdint.h> |
| 45 | 45 |
| 46 #include <list> | 46 #include <list> |
| 47 | 47 |
| 48 #include "base/macros.h" | 48 #include "base/macros.h" |
| 49 #include "net/base/net_export.h" | 49 #include "net/base/net_export.h" |
| 50 #include "net/quic/core/quic_packet_creator.h" | 50 #include "net/quic/core/quic_packet_creator.h" |
| 51 #include "net/quic/core/quic_pending_retransmission.h" |
| 51 #include "net/quic/core/quic_sent_packet_manager.h" | 52 #include "net/quic/core/quic_sent_packet_manager.h" |
| 52 #include "net/quic/core/quic_types.h" | 53 #include "net/quic/core/quic_types.h" |
| 53 | 54 |
| 54 namespace net { | 55 namespace net { |
| 55 | 56 |
| 56 namespace test { | 57 namespace test { |
| 57 class QuicPacketGeneratorPeer; | 58 class QuicPacketGeneratorPeer; |
| 58 } // namespace test | 59 } // namespace test |
| 59 | 60 |
| 60 class NET_EXPORT_PRIVATE QuicPacketGenerator { | 61 class NET_EXPORT_PRIVATE QuicPacketGenerator { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // header of packets encrypted at the initial encryption level. Should only | 134 // header of packets encrypted at the initial encryption level. Should only |
| 134 // be called by servers. | 135 // be called by servers. |
| 135 void SetDiversificationNonce(const DiversificationNonce& nonce); | 136 void SetDiversificationNonce(const DiversificationNonce& nonce); |
| 136 | 137 |
| 137 // Creates a version negotiation packet which supports |supported_versions|. | 138 // Creates a version negotiation packet which supports |supported_versions|. |
| 138 std::unique_ptr<QuicEncryptedPacket> SerializeVersionNegotiationPacket( | 139 std::unique_ptr<QuicEncryptedPacket> SerializeVersionNegotiationPacket( |
| 139 const QuicVersionVector& supported_versions); | 140 const QuicVersionVector& supported_versions); |
| 140 | 141 |
| 141 // Re-serializes frames with the original packet's packet number length. | 142 // Re-serializes frames with the original packet's packet number length. |
| 142 // Used for retransmitting packets to ensure they aren't too long. | 143 // Used for retransmitting packets to ensure they aren't too long. |
| 143 void ReserializeAllFrames(const PendingRetransmission& retransmission, | 144 void ReserializeAllFrames(const QuicPendingRetransmission& retransmission, |
| 144 char* buffer, | 145 char* buffer, |
| 145 size_t buffer_len); | 146 size_t buffer_len); |
| 146 | 147 |
| 147 // Update the packet number length to use in future packets as soon as it | 148 // Update the packet number length to use in future packets as soon as it |
| 148 // can be safely changed. | 149 // can be safely changed. |
| 149 void UpdateSequenceNumberLength(QuicPacketNumber least_packet_awaited_by_peer, | 150 void UpdateSequenceNumberLength(QuicPacketNumber least_packet_awaited_by_peer, |
| 150 QuicPacketCount max_packets_in_flight); | 151 QuicPacketCount max_packets_in_flight); |
| 151 | 152 |
| 152 // Set the minimum number of bytes for the connection id length; | 153 // Set the minimum number of bytes for the connection id length; |
| 153 void SetConnectionIdLength(uint32_t length); | 154 void SetConnectionIdLength(uint32_t length); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 // are referenced elsewhere so that they can later be (optionally) | 211 // are referenced elsewhere so that they can later be (optionally) |
| 211 // retransmitted. | 212 // retransmitted. |
| 212 QuicStopWaitingFrame pending_stop_waiting_frame_; | 213 QuicStopWaitingFrame pending_stop_waiting_frame_; |
| 213 | 214 |
| 214 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); | 215 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); |
| 215 }; | 216 }; |
| 216 | 217 |
| 217 } // namespace net | 218 } // namespace net |
| 218 | 219 |
| 219 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ | 220 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ |
| OLD | NEW |