Automated g4 rollback of changelist 257189926. *** Reason for rollback *** Breaks Chromium *** Original change description *** QuicSpdySession header size limit related cleanup. Rename QuicSpdySession::SpdyFramerVisitor::set_max_uncompressed_header_bytes() to set_max_header_list_size() to match the name of the QuicHeaderList method it calls. Inline set_max_uncompressed_header_bytes() and set_max_decode_buffer_size_bytes() since they are used only once. gfe-relnote: n/a, no functional change. *** PiperOrigin-RevId: 257303500 Change-Id: Id5ee14268d09efe69c1cb242905fd24666478471
diff --git a/quic/core/http/quic_spdy_session.cc b/quic/core/http/quic_spdy_session.cc index c772b98..9e4178f 100644 --- a/quic/core/http/quic_spdy_session.cc +++ b/quic/core/http/quic_spdy_session.cc
@@ -289,8 +289,9 @@ } } - void set_max_header_list_size(size_t max_header_list_size) { - header_list_.set_max_header_list_size(max_header_list_size); + void set_max_uncompressed_header_bytes( + size_t set_max_uncompressed_header_bytes) { + header_list_.set_max_header_list_size(set_max_uncompressed_header_bytes); } private: @@ -391,11 +392,10 @@ /*stream_already_counted = */ false); } - spdy_framer_visitor_->set_max_header_list_size(max_inbound_header_list_size_); + set_max_uncompressed_header_bytes(max_inbound_header_list_size_); // Limit HPACK buffering to 2x header list size limit. - h2_deframer_.GetHpackDecoder()->set_max_decode_buffer_size_bytes( - 2 * max_inbound_header_list_size_); + set_max_decode_buffer_size_bytes(2 * max_inbound_header_list_size_); } void QuicSpdySession::OnDecoderStreamError(QuicStringPiece /*error_message*/) { @@ -720,6 +720,12 @@ set_server_push_enabled(value); } +void QuicSpdySession::set_max_uncompressed_header_bytes( + size_t set_max_uncompressed_header_bytes) { + spdy_framer_visitor_->set_max_uncompressed_header_bytes( + set_max_uncompressed_header_bytes); +} + void QuicSpdySession::CloseConnectionWithDetails(QuicErrorCode error, const std::string& details) { connection()->CloseConnection(
diff --git a/quic/core/http/quic_spdy_session.h b/quic/core/http/quic_spdy_session.h index d5413b3..0a009bf 100644 --- a/quic/core/http/quic_spdy_session.h +++ b/quic/core/http/quic_spdy_session.h
@@ -246,6 +246,16 @@ bool IsConnected() { return connection()->connected(); } + // Sets how much encoded data the hpack decoder of h2_deframer_ is willing to + // buffer. + void set_max_decode_buffer_size_bytes(size_t max_decode_buffer_size_bytes) { + h2_deframer_.GetHpackDecoder()->set_max_decode_buffer_size_bytes( + max_decode_buffer_size_bytes); + } + + void set_max_uncompressed_header_bytes( + size_t set_max_uncompressed_header_bytes); + private: friend class test::QuicSpdySessionPeer;