Add http3_constants.h for HTTP/3 and QPACK unidirectional stream types and settings identifiers. In the future, HTTP/3-specific constants from quic/core/*.h can be moved here, and HTTP/3 and QPACK-specific error codes might also live here. Also update unused kSettingsNumPlaceholders value from 8 to 9 according to https://quicwg.org/base-drafts/draft-ietf-quic-http.html#settings-parameters. Also add unused QPACK settings identifiers. gfe-relnote: n/a, QUIC v99-only change. PiperOrigin-RevId: 258613141 Change-Id: I48cf9d6468ae99018dbe49b74c9740b8e48a287d
diff --git a/quic/core/http/end_to_end_test.cc b/quic/core/http/end_to_end_test.cc index c58d82f..5b9468f 100644 --- a/quic/core/http/end_to_end_test.cc +++ b/quic/core/http/end_to_end_test.cc
@@ -12,6 +12,7 @@ #include <vector> #include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h" +#include "net/third_party/quiche/src/quic/core/http/http_constants.h" #include "net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream.h" #include "net/third_party/quiche/src/quic/core/qpack/qpack_encoder_test_utils.h" #include "net/third_party/quiche/src/quic/core/quic_epoll_connection_helper.h"
diff --git a/quic/core/http/http_constants.h b/quic/core/http/http_constants.h new file mode 100644 index 0000000..2641790 --- /dev/null +++ b/quic/core/http/http_constants.h
@@ -0,0 +1,32 @@ +// Copyright (c) 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef QUICHE_QUIC_CORE_HTTP_HTTP_CONSTANTS_H_ +#define QUICHE_QUIC_CORE_HTTP_HTTP_CONSTANTS_H_ + +#include <cstdint> + +namespace quic { + +// Unidirectional stream types. + +// https://quicwg.org/base-drafts/draft-ietf-quic-http.html#unidirectional-streams +const uint64_t kControlStream = 0x00; +const uint64_t kServerPushStream = 0x01; +// https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#enc-dec-stream-def +const uint64_t kQpackEncoderStream = 0x02; +const uint64_t kQpackDecoderStream = 0x03; + +// Settings identifiers. + +// https://quicwg.org/base-drafts/draft-ietf-quic-http.html#settings-parameters +const uint64_t kSettingsMaxHeaderListSize = 0x06; +const uint64_t kSettingsNumPlaceholders = 0x09; +// https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#configuration +const uint64_t kSettingsQpackMaxTableCapacity = 0x01; +const uint64_t kSettingsQpackBlockedStream = 0x07; + +} // namespace quic + +#endif // QUICHE_QUIC_CORE_HTTP_HTTP_CONSTANTS_H_
diff --git a/quic/core/http/quic_receive_control_stream.cc b/quic/core/http/quic_receive_control_stream.cc index 66b7be6..bc36589 100644 --- a/quic/core/http/quic_receive_control_stream.cc +++ b/quic/core/http/quic_receive_control_stream.cc
@@ -4,6 +4,7 @@ #include "net/third_party/quiche/src/quic/core/http/quic_receive_control_stream.h" +#include "net/third_party/quiche/src/quic/core/http/http_constants.h" #include "net/third_party/quiche/src/quic/core/http/http_decoder.h" #include "net/third_party/quiche/src/quic/core/http/quic_spdy_session.h" #include "net/third_party/quiche/src/quic/platform/api/quic_ptr_util.h"
diff --git a/quic/core/http/quic_receive_control_stream_test.cc b/quic/core/http/quic_receive_control_stream_test.cc index 3601cff..aaf60e9 100644 --- a/quic/core/http/quic_receive_control_stream_test.cc +++ b/quic/core/http/quic_receive_control_stream_test.cc
@@ -4,6 +4,7 @@ #include "net/third_party/quiche/src/quic/core/http/quic_receive_control_stream.h" +#include "net/third_party/quiche/src/quic/core/http/http_constants.h" #include "net/third_party/quiche/src/quic/core/quic_utils.h" #include "net/third_party/quiche/src/quic/platform/api/quic_ptr_util.h" #include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
diff --git a/quic/core/http/quic_send_control_stream.cc b/quic/core/http/quic_send_control_stream.cc index 7943bdc..0634d03 100644 --- a/quic/core/http/quic_send_control_stream.cc +++ b/quic/core/http/quic_send_control_stream.cc
@@ -4,6 +4,7 @@ #include "net/third_party/quiche/src/quic/core/http/quic_send_control_stream.h" +#include "net/third_party/quiche/src/quic/core/http/http_constants.h" #include "net/third_party/quiche/src/quic/core/http/quic_spdy_session.h" #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
diff --git a/quic/core/http/quic_spdy_session.cc b/quic/core/http/quic_spdy_session.cc index 4a8dad7..8bbe7a4 100644 --- a/quic/core/http/quic_spdy_session.cc +++ b/quic/core/http/quic_spdy_session.cc
@@ -9,6 +9,7 @@ #include <string> #include <utility> +#include "net/third_party/quiche/src/quic/core/http/http_constants.h" #include "net/third_party/quiche/src/quic/core/http/quic_headers_stream.h" #include "net/third_party/quiche/src/quic/core/quic_utils.h" #include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
diff --git a/quic/core/http/quic_spdy_session.h b/quic/core/http/quic_spdy_session.h index 1acdbd5..d381d8c 100644 --- a/quic/core/http/quic_spdy_session.h +++ b/quic/core/http/quic_spdy_session.h
@@ -31,16 +31,6 @@ class QuicSpdySessionPeer; } // namespace test -// Unidirectional stream types defined by IETF HTTP/3 draft in section 3.2. -const uint64_t kControlStream = 0; -const uint64_t kServerPushStream = 1; -const uint64_t kQpackEncoderStream = 2; -const uint64_t kQpackDecoderStream = 3; - -// Supported Settings id as defined by IETF HTTP/3 draft in section 7.2.5.1. -const uint64_t kSettingsMaxHeaderListSize = 6; -const uint64_t kSettingsNumPlaceholders = 8; - // QuicHpackDebugVisitor gathers data used for understanding HPACK HoL // dynamics. Specifically, it is to help predict the compression // penalty of avoiding HoL by chagning how the dynamic table is used.
diff --git a/quic/core/http/quic_spdy_session_test.cc b/quic/core/http/quic_spdy_session_test.cc index 36fd20c..35aa1c7 100644 --- a/quic/core/http/quic_spdy_session_test.cc +++ b/quic/core/http/quic_spdy_session_test.cc
@@ -11,6 +11,7 @@ #include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h" #include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h" +#include "net/third_party/quiche/src/quic/core/http/http_constants.h" #include "net/third_party/quiche/src/quic/core/quic_crypto_stream.h" #include "net/third_party/quiche/src/quic/core/quic_data_writer.h" #include "net/third_party/quiche/src/quic/core/quic_packets.h"
diff --git a/quic/core/http/quic_spdy_stream.cc b/quic/core/http/quic_spdy_stream.cc index 55ae33f..b55e928 100644 --- a/quic/core/http/quic_spdy_stream.cc +++ b/quic/core/http/quic_spdy_stream.cc
@@ -8,6 +8,7 @@ #include <string> #include <utility> +#include "net/third_party/quiche/src/quic/core/http/http_constants.h" #include "net/third_party/quiche/src/quic/core/http/http_decoder.h" #include "net/third_party/quiche/src/quic/core/http/quic_spdy_session.h" #include "net/third_party/quiche/src/quic/core/http/spdy_utils.h"
diff --git a/quic/core/qpack/qpack_send_stream_test.cc b/quic/core/qpack/qpack_send_stream_test.cc index 5fee70f..46037c9 100644 --- a/quic/core/qpack/qpack_send_stream_test.cc +++ b/quic/core/qpack/qpack_send_stream_test.cc
@@ -4,6 +4,7 @@ #include "net/third_party/quiche/src/quic/core/qpack/qpack_send_stream.h" +#include "net/third_party/quiche/src/quic/core/http/http_constants.h" #include "net/third_party/quiche/src/quic/platform/api/quic_test.h" #include "net/third_party/quiche/src/quic/test_tools/quic_spdy_session_peer.h" #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"