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

Unified Diff: net/quic/quic_packet_creator.cc

Issue 467263003: Change to optimize QUIC's RetransmittableFrames::HasCryptoHandshake by (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_Update_method_to_QuicAlarm_73125905
Patch Set: Created 6 years, 4 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 | « no previous file | net/quic/quic_protocol.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_creator.cc
diff --git a/net/quic/quic_packet_creator.cc b/net/quic/quic_packet_creator.cc
index 4ad38bb729556d47125f99de48c4170600e0effe..1c3a1a82725d54c632fea0918ee647ce32ff231b 100644
--- a/net/quic/quic_packet_creator.cc
+++ b/net/quic/quic_packet_creator.cc
@@ -502,25 +502,16 @@ bool QuicPacketCreator::AddFrame(const QuicFrame& frame,
}
void QuicPacketCreator::MaybeAddPadding() {
- if (BytesFree() == 0) {
- // Don't pad full packets.
+ if (queued_retransmittable_frames_.get() == NULL) {
return;
}
-
- // If any of the frames in the current packet are on the crypto stream
- // then they contain handshake messagses, and we should pad them.
- bool is_handshake = false;
- for (size_t i = 0; i < queued_frames_.size(); ++i) {
- if (queued_frames_[i].type == STREAM_FRAME &&
- queued_frames_[i].stream_frame->stream_id == kCryptoStreamId) {
- is_handshake = true;
- break;
- }
+ if (!queued_retransmittable_frames_->HasCryptoHandshake()) {
+ return;
}
- if (!is_handshake) {
+ if (BytesFree() == 0) {
+ // Don't pad full packets.
return;
}
-
QuicPaddingFrame padding;
bool success = AddFrame(QuicFrame(&padding), false);
DCHECK(success);
« no previous file with comments | « no previous file | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698