| Index: net/quic/quic_packet_creator.h
|
| diff --git a/net/quic/quic_packet_creator.h b/net/quic/quic_packet_creator.h
|
| index 8c747066adf09e48fa4cc220fe78ec3436b43d05..b823773a183f8b6b6622e0e587b3b4d8a8bb0e97 100644
|
| --- a/net/quic/quic_packet_creator.h
|
| +++ b/net/quic/quic_packet_creator.h
|
| @@ -38,8 +38,11 @@ class NET_EXPORT_PRIVATE QuicPacketCreator {
|
| public:
|
| virtual ~DelegateInterface() {}
|
| // Called when a packet is serialized. Delegate does not take the ownership
|
| - // of |serialized_packet|.
|
| + // of |serialized_packet|, but may take ownership of |packet.packet|
|
| + // and |packet.retransmittable_frames|. If it does so, they must be set
|
| + // to nullptr.
|
| virtual void OnSerializedPacket(SerializedPacket* serialized_packet) = 0;
|
| + virtual void CloseConnection(QuicErrorCode error, bool from_peer) = 0;
|
| // Called when current FEC group is reset (closed).
|
| virtual void OnResetFecGroup() = 0;
|
| };
|
| @@ -177,6 +180,12 @@ class NET_EXPORT_PRIVATE QuicPacketCreator {
|
| // Identical to AddSavedFrame, but allows the frame to be padded.
|
| bool AddPaddedSavedFrame(const QuicFrame& frame);
|
|
|
| + // Adds |listener| to the next serialized packet and notifies the
|
| + // std::listener
|
| + // with |length| as the number of acked bytes.
|
| + void AddAckListener(QuicAckListenerInterface* listener,
|
| + QuicPacketLength length);
|
| +
|
| // Creates a version negotiation packet which supports |supported_versions|.
|
| // Caller owns the created packet. Also, sets the entropy hash of the
|
| // serialized packet to a random bool and returns that value as a member of
|
| @@ -331,6 +340,10 @@ class NET_EXPORT_PRIVATE QuicPacketCreator {
|
| // Fails if |buffer_len| isn't long enough for the encrypted packet.
|
| SerializedPacket SerializePacket(char* encrypted_buffer, size_t buffer_len);
|
|
|
| + // Called after a new SerialiedPacket is created to call the delegate's
|
| + // OnSerializedPacket, reset state, and potentially flush FEC groups.
|
| + void OnSerializedPacket(SerializedPacket* packet);
|
| +
|
| // Turn on FEC protection for subsequent packets. If no FEC group is currently
|
| // open, this method flushes current open packet and then turns FEC on.
|
| void MaybeStartFecProtection();
|
| @@ -409,6 +422,9 @@ class NET_EXPORT_PRIVATE QuicPacketCreator {
|
| scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_;
|
| // If true, the packet will be padded up to |max_packet_length_|.
|
| bool needs_padding_;
|
| + // Stores ack std::listeners that should be attached to the next packet.
|
| + std::list<AckListenerWrapper> ack_listeners_;
|
| +
|
| // FEC policy that specifies when to send FEC packet.
|
| FecSendPolicy fec_send_policy_;
|
| // Timeout used for FEC alarm. Can be set to zero initially or if the SRTT has
|
|
|