QuicSpdySession header size limit related cleanup. This relands cr/257189926 which was reverted at cr/257303500 because in Chromium, QuicChromiumClientSession::Initialize() called set_max_uncompressed_header_bytes(). That call was since removed at https://crrev.com/c/1693401. 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: 259756568 Change-Id: I6c94e0d32ff418fdb8ccd14382bd9dd16fa82d39
diff --git a/quic/core/http/quic_spdy_session.cc b/quic/core/http/quic_spdy_session.cc index 6f39445..e306062 100644 --- a/quic/core/http/quic_spdy_session.cc +++ b/quic/core/http/quic_spdy_session.cc
@@ -290,9 +290,8 @@ } } - 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); + void set_max_header_list_size(size_t max_header_list_size) { + header_list_.set_max_header_list_size(max_header_list_size); } private: @@ -393,10 +392,11 @@ /*stream_already_counted = */ false); } - set_max_uncompressed_header_bytes(max_inbound_header_list_size_); + spdy_framer_visitor_->set_max_header_list_size(max_inbound_header_list_size_); // Limit HPACK buffering to 2x header list size limit. - set_max_decode_buffer_size_bytes(2 * max_inbound_header_list_size_); + h2_deframer_.GetHpackDecoder()->set_max_decode_buffer_size_bytes( + 2 * max_inbound_header_list_size_); } void QuicSpdySession::OnDecoderStreamError(QuicStringPiece /*error_message*/) { @@ -736,12 +736,6 @@ 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 8dfc47a..aa2c27d 100644 --- a/quic/core/http/quic_spdy_session.h +++ b/quic/core/http/quic_spdy_session.h
@@ -233,16 +233,6 @@ 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;