Replace direct uses of deprecated ParameterizedMember fields with accessors
The public member, member_is_inner_list, and params fields are difficult to use correctly and are deprecated in favor of accessor methods (from cl/972540694) that do the right thing based on the internal representation, which is being changed to std::variant.
The accessor methods return an optional pair of the item/inner list and its parameters. Once the representation is changed, a simpler GetIfItem and GetIfInnerList API will be exposed, returning a possibly null pointer to the ParameterizedItem or InnerList.
This contains no intentional observable behavioral differences.
Tested:
TAP for global presubmit queue
http://test/OCL:972580757:BASE:972720787:1787944376123:43b83152
PiperOrigin-RevId: 972761959
diff --git a/quiche/quic/core/quic_stream_priority.cc b/quiche/quic/core/quic_stream_priority.cc
index ed5df86..2a1d041 100644
--- a/quiche/quic/core/quic_stream_priority.cc
+++ b/quiche/quic/core/quic_stream_priority.cc
@@ -54,20 +54,15 @@
bool incremental = HttpStreamPriority::kDefaultIncremental;
for (const auto& [name, value] : *parsed_dictionary) {
- if (value.member_is_inner_list) {
+ const std::optional<
+ std::pair<const quiche::structured_headers::Item&,
+ const quiche::structured_headers::Parameters&>>
+ item_and_params = value.GetWithParamsIfItem();
+ if (!item_and_params.has_value()) {
continue;
}
- const std::vector<quiche::structured_headers::ParameterizedItem>& member =
- value.member;
- if (member.size() != 1) {
- // If `member_is_inner_list` is false above,
- // then `member` should have exactly one element.
- QUICHE_BUG(priority_field_value_parsing_internal_error);
- continue;
- }
-
- const quiche::structured_headers::Item& item = member[0].item;
+ const quiche::structured_headers::Item& item = item_and_params->first;
if (name == HttpStreamPriority::kUrgencyKey) {
const int64_t* parsed_urgency = item.GetIfInteger();
// Ignore out-of-range values.