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

Unified Diff: net/quic/quic_framer.h

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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_flags.cc ('k') | net/quic/quic_framer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_framer.h
diff --git a/net/quic/quic_framer.h b/net/quic/quic_framer.h
index 0504d3d8854677df586df6e201e37e5751d6c12a..3cfaa88d37201bd1dfd5892b4752b9a4eb4d3d54 100644
--- a/net/quic/quic_framer.h
+++ b/net/quic/quic_framer.h
@@ -301,18 +301,19 @@ class NET_EXPORT_PRIVATE QuicFramer {
bool includes_version,
QuicSequenceNumberLength sequence_number_length);
- // Returns a SerializedPacket whose |packet| member is owned by the caller,
- // is created from the first |num_frames| frames, or is nullptr if the packet
- // could not be created. The packet must be of size |packet_size|.
- SerializedPacket BuildDataPacket(const QuicPacketHeader& header,
- const QuicFrames& frames,
- size_t packet_size);
-
- // Returns a SerializedPacket whose |packet| member is owned by the caller,
- // and is populated with the fields in |header| and |fec|, or is nullptr if
- // the packet could not be created.
- SerializedPacket BuildFecPacket(const QuicPacketHeader& header,
- const QuicFecData& fec);
+ // Returns a QuicPacket* that is owned by the caller, is created from
+ // |frames|. Returns nullptr if the packet could not be created.
+ // The packet must be of size |packet_size|.
+ QuicPacket* BuildDataPacket(const QuicPacketHeader& header,
+ const QuicFrames& frames,
+ char* buffer,
+ size_t packet_length);
+
+ // Returns a QuicPacket* that is owned by the caller, and is populated with
+ // the fields in |header| and |fec|. Returns nullptr if the packet could
+ // not be created.
+ QuicPacket* BuildFecPacket(const QuicPacketHeader& header,
+ const QuicFecData& fec);
// Returns a new public reset packet, owned by the caller.
static QuicEncryptedPacket* BuildPublicResetPacket(
@@ -371,6 +372,9 @@ class NET_EXPORT_PRIVATE QuicFramer {
bool is_server() const { return is_server_; }
+ static QuicPacketEntropyHash GetPacketEntropyHash(
+ const QuicPacketHeader& header);
+
private:
friend class test::QuicFramerPeer;
@@ -386,11 +390,10 @@ class NET_EXPORT_PRIVATE QuicFramer {
NackRangeMap nack_ranges;
};
- QuicPacketEntropyHash GetPacketEntropyHash(
- const QuicPacketHeader& header) const;
-
bool ProcessDataPacket(const QuicPacketPublicHeader& public_header,
- const QuicEncryptedPacket& packet);
+ const QuicEncryptedPacket& packet,
+ char* decrypted_buffer,
+ size_t buffer_length);
bool ProcessPublicResetPacket(const QuicPacketPublicHeader& public_header);
@@ -398,8 +401,12 @@ class NET_EXPORT_PRIVATE QuicFramer {
bool ProcessPublicHeader(QuicPacketPublicHeader* header);
+ // |decrypted_buffer| must be allocated to be large enough to hold the
+ // unencrypted contents of |packet|.
bool ProcessPacketHeader(QuicPacketHeader* header,
- const QuicEncryptedPacket& packet);
+ const QuicEncryptedPacket& packet,
+ char* decrypted_buffer,
+ size_t buffer_length);
bool ProcessPacketSequenceNumber(
QuicSequenceNumberLength sequence_number_length,
@@ -417,7 +424,9 @@ class NET_EXPORT_PRIVATE QuicFramer {
bool ProcessBlockedFrame(QuicBlockedFrame* frame);
bool DecryptPayload(const QuicPacketHeader& header,
- const QuicEncryptedPacket& packet);
+ const QuicEncryptedPacket& packet,
+ char* decrypted_buffer,
+ size_t buffer_length);
// Returns the full packet sequence number from the truncated
// wire format version and the last seen packet sequence number.
@@ -497,8 +506,6 @@ class NET_EXPORT_PRIVATE QuicFramer {
QuicPacketSequenceNumber last_sequence_number_;
// Updated by WritePacketHeader.
QuicConnectionId last_serialized_connection_id_;
- // Buffer containing decrypted payload data during parsing.
- scoped_ptr<QuicData> decrypted_;
// Version of the protocol being used.
QuicVersion quic_version_;
// This vector contains QUIC versions which we currently support.
« no previous file with comments | « net/quic/quic_flags.cc ('k') | net/quic/quic_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698