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

Unified Diff: net/quic/quic_packet_creator.h

Issue 1525303003: Remove QuicPacketGenerator::OnSerializedPacket with functionality in QuicPacketCreator. No functio… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@110008813
Patch Set: get newly added files from upstream Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | net/quic/quic_packet_creator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | net/quic/quic_packet_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698