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

Side by Side Diff: net/quic/quic_packet_generator.h

Issue 1811043002: Landing Recent QUIC changes until 2016-03-15 16:26 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add an export clause. Created 4 years, 9 months 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 unified diff | Download patch
OLDNEW
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 class NET_EXPORT_PRIVATE QuicPacketGenerator { 59 class NET_EXPORT_PRIVATE QuicPacketGenerator {
60 public: 60 public:
61 class NET_EXPORT_PRIVATE DelegateInterface 61 class NET_EXPORT_PRIVATE DelegateInterface
62 : public QuicPacketCreator::DelegateInterface { 62 : public QuicPacketCreator::DelegateInterface {
63 public: 63 public:
64 ~DelegateInterface() override {} 64 ~DelegateInterface() override {}
65 // Consults delegate whether a packet should be generated. 65 // Consults delegate whether a packet should be generated.
66 virtual bool ShouldGeneratePacket(HasRetransmittableData retransmittable, 66 virtual bool ShouldGeneratePacket(HasRetransmittableData retransmittable,
67 IsHandshake handshake) = 0; 67 IsHandshake handshake) = 0;
68 virtual void PopulateAckFrame(QuicAckFrame* ack) = 0; 68 virtual void PopulateAckFrame(QuicAckFrame* ack) = 0;
69 virtual const QuicFrame GetUpdatedAckFrame() = 0;
69 virtual void PopulateStopWaitingFrame( 70 virtual void PopulateStopWaitingFrame(
70 QuicStopWaitingFrame* stop_waiting) = 0; 71 QuicStopWaitingFrame* stop_waiting) = 0;
71 }; 72 };
72 73
73 QuicPacketGenerator(QuicConnectionId connection_id, 74 QuicPacketGenerator(QuicConnectionId connection_id,
74 QuicFramer* framer, 75 QuicFramer* framer,
75 QuicRandom* random_generator, 76 QuicRandom* random_generator,
76 QuicBufferAllocator* buffer_allocator, 77 QuicBufferAllocator* buffer_allocator,
77 DelegateInterface* delegate); 78 DelegateInterface* delegate);
78 79
(...skipping 28 matching lines...) Expand all
107 // Disables flushing. 108 // Disables flushing.
108 void StartBatchOperations(); 109 void StartBatchOperations();
109 // Enables flushing and flushes queued data which can be sent. 110 // Enables flushing and flushes queued data which can be sent.
110 void FinishBatchOperations(); 111 void FinishBatchOperations();
111 112
112 // Flushes all queued frames, even frames which are not sendable. 113 // Flushes all queued frames, even frames which are not sendable.
113 void FlushAllQueuedFrames(); 114 void FlushAllQueuedFrames();
114 115
115 bool HasQueuedFrames() const; 116 bool HasQueuedFrames() const;
116 117
118 // Whether the pending packet has no frames in it at the moment.
119 bool IsPendingPacketEmpty() const;
120
117 // Makes the framer not serialize the protocol version in sent packets. 121 // Makes the framer not serialize the protocol version in sent packets.
118 void StopSendingVersion(); 122 void StopSendingVersion();
119 123
120 // Creates a version negotiation packet which supports |supported_versions|. 124 // Creates a version negotiation packet which supports |supported_versions|.
121 // Caller owns the created packet. Also, sets the entropy hash of the 125 // Caller owns the created packet. Also, sets the entropy hash of the
122 // serialized packet to a random bool and returns that value as a member of 126 // serialized packet to a random bool and returns that value as a member of
123 // SerializedPacket. 127 // SerializedPacket.
124 QuicEncryptedPacket* SerializeVersionNegotiationPacket( 128 QuicEncryptedPacket* SerializeVersionNegotiationPacket(
125 const QuicVersionVector& supported_versions); 129 const QuicVersionVector& supported_versions);
126 130
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // retransmitted. 201 // retransmitted.
198 QuicAckFrame pending_ack_frame_; 202 QuicAckFrame pending_ack_frame_;
199 QuicStopWaitingFrame pending_stop_waiting_frame_; 203 QuicStopWaitingFrame pending_stop_waiting_frame_;
200 204
201 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); 205 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator);
202 }; 206 };
203 207
204 } // namespace net 208 } // namespace net
205 209
206 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ 210 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_
OLDNEW
« no previous file with comments | « net/quic/quic_multipath_received_packet_manager_test.cc ('k') | net/quic/quic_packet_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698