gfe-relnote: Consolidate constants with the same value. No functional change. Not protected.
Use HpackEntry::kSizeOverhead in spdy code, use QpackEntry::kSizeOverhead in
quic code. (QpackEntry is an alias to HpackEntry defined in
qpack_header_table.h.) Remove redundant kHeaderFieldSizeOverhead and
kPerHeaderOverhead.
PiperOrigin-RevId: 305517355
Change-Id: I8591960616054f6d91e3c9cc62cb2281a506046e
diff --git a/quic/core/http/quic_header_list.cc b/quic/core/http/quic_header_list.cc
index cbf60ce..cbfc2e9 100644
--- a/quic/core/http/quic_header_list.cc
+++ b/quic/core/http/quic_header_list.cc
@@ -7,10 +7,10 @@
#include <limits>
#include <string>
+#include "net/third_party/quiche/src/quic/core/qpack/qpack_header_table.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
-#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
namespace quic {
@@ -43,7 +43,7 @@
if (current_header_list_size_ < max_header_list_size_) {
current_header_list_size_ += name.size();
current_header_list_size_ += value.size();
- current_header_list_size_ += spdy::kPerHeaderOverhead;
+ current_header_list_size_ += QpackEntry::kSizeOverhead;
header_list_.emplace_back(std::string(name), std::string(value));
}
}
diff --git a/quic/core/qpack/qpack_decoded_headers_accumulator.cc b/quic/core/qpack/qpack_decoded_headers_accumulator.cc
index 7aa0f11..6469dd2 100644
--- a/quic/core/qpack/qpack_decoded_headers_accumulator.cc
+++ b/quic/core/qpack/qpack_decoded_headers_accumulator.cc
@@ -5,16 +5,11 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_decoder.h"
+#include "net/third_party/quiche/src/quic/core/qpack/qpack_header_table.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
-namespace {
-
-size_t kHeaderFieldSizeOverhead = 32;
-
-}
-
QpackDecodedHeadersAccumulator::QpackDecodedHeadersAccumulator(
QuicStreamId id,
QpackDecoder* qpack_decoder,
@@ -44,7 +39,7 @@
}
uncompressed_header_bytes_including_overhead_ +=
- name.size() + value.size() + kHeaderFieldSizeOverhead;
+ name.size() + value.size() + QpackEntry::kSizeOverhead;
if (uncompressed_header_bytes_including_overhead_ > max_header_list_size_) {
header_list_size_limit_exceeded_ = true;
diff --git a/spdy/core/spdy_protocol.h b/spdy/core/spdy_protocol.h
index 54723da..0bf8bb9 100644
--- a/spdy/core/spdy_protocol.h
+++ b/spdy/core/spdy_protocol.h
@@ -319,8 +319,6 @@
const size_t kMaxFrameSizeLimit = kSpdyMaxFrameSizeLimit + kFrameHeaderSize;
// Size of a header block size field.
const size_t kSizeOfSizeField = sizeof(uint32_t);
-// Per-header overhead for block size accounting in bytes.
-const size_t kPerHeaderOverhead = 32;
// Initial window size for a stream in bytes.
const int32_t kInitialStreamWindowSize = 64 * 1024 - 1;
// Initial window size for a session in bytes.