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

Unified Diff: net/quic/quic_protocol.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 | « net/quic/quic_protocol.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_protocol.cc
diff --git a/net/quic/quic_protocol.cc b/net/quic/quic_protocol.cc
index 419820a8c1ceeb5d5a761e77924ae771ff4a8e0c..66925ba1a15e041c59f5b894265ba80da63835fa 100644
--- a/net/quic/quic_protocol.cc
+++ b/net/quic/quic_protocol.cc
@@ -622,7 +622,8 @@ StringPiece QuicPacket::Plaintext() const {
}
RetransmittableFrames::RetransmittableFrames()
- : encryption_level_(NUM_ENCRYPTION_LEVELS) {
+ : encryption_level_(NUM_ENCRYPTION_LEVELS),
+ has_crypto_handshake_(NOT_HANDSHAKE) {
}
RetransmittableFrames::~RetransmittableFrames() {
@@ -677,6 +678,9 @@ const QuicFrame& RetransmittableFrames::AddStreamFrame(
stream_frame->data.Append(const_cast<char*>(stream_data_.back()->data()),
stream_data_.back()->size());
frames_.push_back(QuicFrame(stream_frame));
+ if (stream_frame->stream_id == kCryptoStreamId) {
+ has_crypto_handshake_ = IS_HANDSHAKE;
+ }
return frames_.back();
}
@@ -687,16 +691,6 @@ const QuicFrame& RetransmittableFrames::AddNonStreamFrame(
return frames_.back();
}
-IsHandshake RetransmittableFrames::HasCryptoHandshake() const {
- for (size_t i = 0; i < frames().size(); ++i) {
- if (frames()[i].type == STREAM_FRAME &&
- frames()[i].stream_frame->stream_id == kCryptoStreamId) {
- return IS_HANDSHAKE;
- }
- }
- return NOT_HANDSHAKE;
-}
-
void RetransmittableFrames::set_encryption_level(EncryptionLevel level) {
encryption_level_ = level;
}
« no previous file with comments | « net/quic/quic_protocol.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698