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

Unified Diff: net/quic/quic_utils.cc

Issue 1667003002: Replace QuicEncryptedPacket's fields with equivalents in SerializedPacket. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@113395732
Patch Set: Created 4 years, 11 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_utils.h ('k') | net/quic/test_tools/quic_packet_creator_peer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_utils.cc
diff --git a/net/quic/quic_utils.cc b/net/quic/quic_utils.cc
index 7973e481d983a5f795ddff98a628475132674257..d90af26e67a6c604bf75a419caf9ff25ab23774a 100644
--- a/net/quic/quic_utils.cc
+++ b/net/quic/quic_utils.cc
@@ -458,8 +458,8 @@ void QuicUtils::ClearSerializedPacket(SerializedPacket* serialized_packet) {
if (!serialized_packet->retransmittable_frames.empty()) {
DeleteFrames(&serialized_packet->retransmittable_frames);
}
- delete serialized_packet->packet;
- serialized_packet->packet = nullptr;
+ serialized_packet->encrypted_buffer = nullptr;
+ serialized_packet->encrypted_length = 0;
}
// static
@@ -477,4 +477,10 @@ uint64_t QuicUtils::PackPathIdAndPacketNumber(QuicPathId path_id,
return path_id_packet_number;
}
+char* QuicUtils::CopyBuffer(const SerializedPacket& packet) {
+ char* dst_buffer = new char[packet.encrypted_length];
+ memcpy(dst_buffer, packet.encrypted_buffer, packet.encrypted_length);
+ return dst_buffer;
+}
+
} // namespace net
« no previous file with comments | « net/quic/quic_utils.h ('k') | net/quic/test_tools/quic_packet_creator_peer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698