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

Unified Diff: net/quic/quic_packet_creator.h

Issue 12806002: Land Recent QUIC Changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor comment fix Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_network_transaction_unittest.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 e3fdc2bfef753dd051efe1e15acbea02605f3290..60f9fb48dd759d8a2f76a1bde449520ea9f31078 100644
--- a/net/quic/quic_packet_creator.h
+++ b/net/quic/quic_packet_creator.h
@@ -19,6 +19,9 @@
#include "net/quic/quic_protocol.h"
namespace net {
+namespace test {
+class QuicPacketCreatorPeer;
+}
class QuicRandom;
@@ -41,7 +44,8 @@ class NET_EXPORT_PRIVATE QuicPacketCreator : public QuicFecBuilderInterface {
// QuicRandom* required for packet entropy.
QuicPacketCreator(QuicGuid guid,
QuicFramer* framer,
- QuicRandom* random_generator);
+ QuicRandom* random_generator,
+ bool is_server);
virtual ~QuicPacketCreator();
@@ -57,6 +61,9 @@ class NET_EXPORT_PRIVATE QuicPacketCreator : public QuicFecBuilderInterface {
// and there is not already an FEC group open.
void MaybeStartFEC();
+ // Makes the framer not serialize the protocol version in sent packets.
+ void StopSendingVersion();
+
// The overhead the framing will add for a packet with num_frames frames.
static size_t StreamFramePacketOverhead(int num_frames, bool include_version);
@@ -108,6 +115,13 @@ class NET_EXPORT_PRIVATE QuicPacketCreator : public QuicFecBuilderInterface {
SerializedPacket SerializeConnectionClose(
QuicConnectionCloseFrame* close_frame);
+ // 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
+ // SerializedPacket.
+ QuicEncryptedPacket* SerializeVersionNegotiationPacket(
+ const QuicVersionTagList& supported_versions);
+
QuicPacketSequenceNumber sequence_number() const {
return sequence_number_;
}
@@ -121,6 +135,8 @@ class NET_EXPORT_PRIVATE QuicPacketCreator : public QuicFecBuilderInterface {
}
private:
+ friend class test::QuicPacketCreatorPeer;
+
static bool ShouldRetransmit(const QuicFrame& frame);
void FillPacketHeader(QuicFecGroupNumber fec_group,
@@ -139,6 +155,11 @@ class NET_EXPORT_PRIVATE QuicPacketCreator : public QuicFecBuilderInterface {
QuicPacketSequenceNumber sequence_number_;
QuicFecGroupNumber fec_group_number_;
scoped_ptr<QuicFecGroup> fec_group_;
+ // bool to keep track if this packet creator is being used the server.
+ bool is_server_;
+ // Controls whether protocol version should be included while serializing the
+ // packet.
+ bool send_version_in_packet_;
size_t packet_size_;
QuicFrames queued_frames_;
scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_;
« no previous file with comments | « net/quic/quic_network_transaction_unittest.cc ('k') | net/quic/quic_packet_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698