#cana-http 1/2: Pass the HTTP/3 SETTINGS wire order to QuicSpdySession::OnSettingsFrame.

SettingsFrame::values is an absl::flat_hash_map, so the order in which a peer sent its SETTINGS identifiers is lost as soon as HttpDecoder parses the frame. Some consumers (e.g. GFE, which logs client settings for passive fingerprinting) need that order.

This change keeps SettingsFrame and SettingsMap as they are, so the two SettingsFrame objects that live as long as a connection do not grow, and passes the wire order alongside the received frame on the receive path:

- HttpDecoder::Visitor::OnSettingsFrame gains an `absl::Span<const uint64_t> wire_order` parameter holding the identifiers in the order they appeared on the wire. The span is backed by a vector local to HttpDecoder::ProcessInput and is only valid for the duration of the call.
- QuicSpdySession::OnSettingsFrame gains the same `wire_order` parameter, and QuicReceiveControlStream passes it through. QuicSpdySession itself ignores it; subclasses that want the order can read it.

All overrides in google3 are updated to accept the span and pass it to the base call: QuicSpdyClientSessionBase, WebTransportOnlyServerSession, MasqueClientSession, MasqueServerSession, GfeQuicServerSession, EnvoyQuicClientSession, and the WebTransport test client in media/webrtc. HttpDecoder::Visitor implementations (QuicReceiveControlStream, QuicSpdyStream, the ALPS decoder, MockHttpDecoderVisitor, the net/quic fuzz visitor) are updated likewise. Test call sites pass an empty wire_order.

For Envoy, the change to third_party/envoy/src is also captured in piper_patches/quiche_settings_wire_order.diff and applied by piper-import-transformations.bara.sky per go/patching-envoy-for-quiche, so the next QUICHE roll into Envoy keeps compiling. Chromium is handled by the QUICHE roll rotation.

NOT generated via copybara.

No behavior change: every implementation ignores wire_order. A GFE follow-up records it behind a flag.

Tests: HttpDecoder reports the wire order for non-ascending identifiers (whole frame and byte by byte) and for the empty frame; existing decoder tests assert the order for sorted input.
PiperOrigin-RevId: 1009066517
diff --git a/quiche/quic/core/http/http_decoder.cc b/quiche/quic/core/http/http_decoder.cc
index 4b90a59..c485ad3 100644
--- a/quiche/quic/core/http/http_decoder.cc
+++ b/quiche/quic/core/http/http_decoder.cc
@@ -8,6 +8,7 @@
 #include <cstdint>
 #include <string>
 #include <utility>
+#include <vector>
 
 #include "absl/base/attributes.h"
 #include "absl/strings/string_view.h"
@@ -557,10 +558,11 @@
     }
     case static_cast<uint64_t>(HttpFrameType::SETTINGS): {
       SettingsFrame frame;
-      if (!ParseSettingsFrame(reader, frame)) {
+      std::vector<uint64_t> wire_order;
+      if (!ParseSettingsFrame(reader, frame, wire_order)) {
         return false;
       }
-      return visitor_->OnSettingsFrame(frame);
+      return visitor_->OnSettingsFrame(frame, wire_order);
     }
     case static_cast<uint64_t>(HttpFrameType::GOAWAY): {
       GoAwayFrame frame;
@@ -646,7 +648,8 @@
 }
 
 bool HttpDecoder::ParseSettingsFrame(QuicDataReader& reader,
-                                     SettingsFrame& frame) {
+                                     SettingsFrame& frame,
+                                     std::vector<uint64_t>& wire_order) {
   while (!reader.IsDoneReading()) {
     uint64_t id;
     if (!reader.ReadVarInt62(&id)) {
@@ -664,6 +667,7 @@
                  "Duplicate setting identifier.");
       return false;
     }
+    wire_order.push_back(id);
   }
   return true;
 }
diff --git a/quiche/quic/core/http/http_decoder.h b/quiche/quic/core/http/http_decoder.h
index 2368c74..2ec9d36 100644
--- a/quiche/quic/core/http/http_decoder.h
+++ b/quiche/quic/core/http/http_decoder.h
@@ -6,9 +6,11 @@
 #define QUICHE_QUIC_CORE_HTTP_HTTP_DECODER_H_
 
 #include <cstdint>
+#include <vector>
 
 #include "absl/base/nullability.h"
 #include "absl/strings/string_view.h"
+#include "absl/types/span.h"
 #include "quiche/quic/core/http/http_frames.h"
 #include "quiche/quic/core/quic_error_codes.h"
 #include "quiche/quic/core/quic_types.h"
@@ -49,8 +51,12 @@
     // Called when a SETTINGS frame has been received.
     virtual bool OnSettingsFrameStart(QuicByteCount header_length) = 0;
 
-    // Called when a SETTINGS frame has been successfully parsed.
-    virtual bool OnSettingsFrame(const SettingsFrame& frame) = 0;
+    // Called when a SETTINGS frame has been successfully parsed. |wire_order|
+    // holds the setting identifiers in the order they appeared on the wire;
+    // SettingsFrame::values is unordered. |wire_order| is only valid for the
+    // duration of the call.
+    virtual bool OnSettingsFrame(const SettingsFrame& frame,
+                                 absl::Span<const uint64_t> wire_order) = 0;
 
     // Called when a DATA frame has been received.
     // |header_length| and |payload_length| are the length of DATA frame header
@@ -250,8 +256,10 @@
   // Sets |error_| and |error_detail_| accordingly.
   void RaiseError(QuicErrorCode error, std::string error_detail);
 
-  // Parses the payload of a SETTINGS frame from |reader| into |frame|.
-  bool ParseSettingsFrame(QuicDataReader& reader, SettingsFrame& frame);
+  // Parses the payload of a SETTINGS frame from |reader| into |frame|, and
+  // appends each setting identifier to |wire_order| in the order it was read.
+  bool ParseSettingsFrame(QuicDataReader& reader, SettingsFrame& frame,
+                          std::vector<uint64_t>& wire_order);
 
   // Parses the payload of a PRIORITY_UPDATE frame (draft-02, type 0xf0700)
   // from |reader| into |frame|.
diff --git a/quiche/quic/core/http/http_decoder_test.cc b/quiche/quic/core/http/http_decoder_test.cc
index edd2341..f5d267b 100644
--- a/quiche/quic/core/http/http_decoder_test.cc
+++ b/quiche/quic/core/http/http_decoder_test.cc
@@ -27,6 +27,7 @@
 using ::testing::ElementsAre;
 using ::testing::Eq;
 using ::testing::InSequence;
+using ::testing::IsEmpty;
 using ::testing::Return;
 
 namespace quic {
@@ -47,7 +48,7 @@
     ON_CALL(visitor_, OnMaxPushIdFrame()).WillByDefault(Return(true));
     ON_CALL(visitor_, OnGoAwayFrame(_)).WillByDefault(Return(true));
     ON_CALL(visitor_, OnSettingsFrameStart(_)).WillByDefault(Return(true));
-    ON_CALL(visitor_, OnSettingsFrame(_)).WillByDefault(Return(true));
+    ON_CALL(visitor_, OnSettingsFrame(_, _)).WillByDefault(Return(true));
     ON_CALL(visitor_, OnDataFrameStart(_, _)).WillByDefault(Return(true));
     ON_CALL(visitor_, OnDataFramePayload(_)).WillByDefault(Return(true));
     ON_CALL(visitor_, OnDataFrameEnd()).WillByDefault(Return(true));
@@ -241,7 +242,8 @@
   EXPECT_EQ(2u, processed_bytes);
   remaining_input = remaining_input.substr(processed_bytes);
 
-  EXPECT_CALL(visitor_, OnSettingsFrame(frame)).WillOnce(Return(false));
+  EXPECT_CALL(visitor_, OnSettingsFrame(frame, ElementsAre(1, 6, 256)))
+      .WillOnce(Return(false));
   processed_bytes = ProcessInputWithGarbageAppended(remaining_input);
   EXPECT_EQ(remaining_input.size(), processed_bytes);
   EXPECT_THAT(decoder_.error(), IsQuicNoError());
@@ -250,7 +252,7 @@
 
   // Process the full frame.
   EXPECT_CALL(visitor_, OnSettingsFrameStart(2));
-  EXPECT_CALL(visitor_, OnSettingsFrame(frame));
+  EXPECT_CALL(visitor_, OnSettingsFrame(frame, ElementsAre(1, 6, 256)));
   EXPECT_EQ(input.size(), ProcessInput(input));
   EXPECT_THAT(decoder_.error(), IsQuicNoError());
   EXPECT_EQ("", decoder_.error_detail());
@@ -258,13 +260,46 @@
 
   // Process the frame incrementally.
   EXPECT_CALL(visitor_, OnSettingsFrameStart(2));
-  EXPECT_CALL(visitor_, OnSettingsFrame(frame));
+  EXPECT_CALL(visitor_, OnSettingsFrame(frame, ElementsAre(1, 6, 256)));
   ProcessInputCharByChar(input);
   EXPECT_THAT(decoder_.error(), IsQuicNoError());
   EXPECT_EQ("", decoder_.error_detail());
   EXPECT_THAT(decoder_.decoded_frame_types(), ElementsAre(4, 4, 4));
 }
 
+TEST_F(HttpDecoderTest, SettingsFrameWireOrder) {
+  // Identifiers are deliberately not in ascending order; |wire_order| must
+  // report them as they appeared on the wire, while |values| is unordered.
+  std::string input;
+  ASSERT_TRUE(absl::HexStringToBytes(
+      "04"    // type (SETTINGS)
+      "07"    // length
+      "06"    // identifier (SETTINGS_MAX_HEADER_LIST_SIZE)
+      "05"    // content
+      "4100"  // identifier, encoded on 2 bytes (0x40), value is 256 (0x100)
+      "04"    // content
+      "01"    // identifier (SETTINGS_QPACK_MAX_TABLE_CAPACITY)
+      "02",   // content
+      &input));
+
+  SettingsFrame frame;
+  frame.values[1] = 2;
+  frame.values[6] = 5;
+  frame.values[256] = 4;
+
+  // Process the full frame.
+  EXPECT_CALL(visitor_, OnSettingsFrameStart(2));
+  EXPECT_CALL(visitor_, OnSettingsFrame(frame, ElementsAre(6, 256, 1)));
+  EXPECT_EQ(input.size(), ProcessInput(input));
+  EXPECT_THAT(decoder_.error(), IsQuicNoError());
+
+  // Process the frame incrementally.
+  EXPECT_CALL(visitor_, OnSettingsFrameStart(2));
+  EXPECT_CALL(visitor_, OnSettingsFrame(frame, ElementsAre(6, 256, 1)));
+  ProcessInputCharByChar(input);
+  EXPECT_THAT(decoder_.error(), IsQuicNoError());
+}
+
 TEST_F(HttpDecoderTest, CorruptSettingsFrame) {
   const char* const kPayload =
       "\x42\x11"                           // two-byte id
@@ -828,7 +863,7 @@
   EXPECT_CALL(visitor_, OnSettingsFrameStart(2));
 
   SettingsFrame empty_frame;
-  EXPECT_CALL(visitor_, OnSettingsFrame(empty_frame));
+  EXPECT_CALL(visitor_, OnSettingsFrame(empty_frame, IsEmpty()));
 
   EXPECT_EQ(input.size(), ProcessInput(input));
   EXPECT_THAT(decoder_.error(), IsQuicNoError());
diff --git a/quiche/quic/core/http/quic_receive_control_stream.cc b/quiche/quic/core/http/quic_receive_control_stream.cc
index 46b3a7c..0ed243c 100644
--- a/quiche/quic/core/http/quic_receive_control_stream.cc
+++ b/quiche/quic/core/http/quic_receive_control_stream.cc
@@ -86,10 +86,11 @@
   return ValidateFrameType(HttpFrameType::SETTINGS);
 }
 
-bool QuicReceiveControlStream::OnSettingsFrame(const SettingsFrame& frame) {
+bool QuicReceiveControlStream::OnSettingsFrame(
+    const SettingsFrame& frame, absl::Span<const uint64_t> wire_order) {
   QUIC_DVLOG(1) << "Control Stream " << id()
                 << " received settings frame: " << frame;
-  return spdy_session_->OnSettingsFrame(frame);
+  return spdy_session_->OnSettingsFrame(frame, wire_order);
 }
 
 bool QuicReceiveControlStream::OnDataFrameStart(QuicByteCount /*header_length*/,
diff --git a/quiche/quic/core/http/quic_receive_control_stream.h b/quiche/quic/core/http/quic_receive_control_stream.h
index 0b33877..58ffbd8 100644
--- a/quiche/quic/core/http/quic_receive_control_stream.h
+++ b/quiche/quic/core/http/quic_receive_control_stream.h
@@ -5,6 +5,7 @@
 #ifndef QUICHE_QUIC_CORE_HTTP_QUIC_RECEIVE_CONTROL_STREAM_H_
 #define QUICHE_QUIC_CORE_HTTP_QUIC_RECEIVE_CONTROL_STREAM_H_
 
+#include "absl/types/span.h"
 #include "quiche/quic/core/http/http_decoder.h"
 #include "quiche/quic/core/quic_stream.h"
 #include "quiche/quic/core/quic_types.h"
@@ -37,7 +38,8 @@
   bool OnMaxPushIdFrame() override;
   bool OnGoAwayFrame(const GoAwayFrame& frame) override;
   bool OnSettingsFrameStart(QuicByteCount header_length) override;
-  bool OnSettingsFrame(const SettingsFrame& frame) override;
+  bool OnSettingsFrame(const SettingsFrame& frame,
+                       absl::Span<const uint64_t> wire_order) override;
   bool OnDataFrameStart(QuicByteCount header_length,
                         QuicByteCount payload_length) override;
   bool OnDataFramePayload(absl::string_view payload) override;
diff --git a/quiche/quic/core/http/quic_spdy_client_session_base.cc b/quiche/quic/core/http/quic_spdy_client_session_base.cc
index d080191..104b3d7 100644
--- a/quiche/quic/core/http/quic_spdy_client_session_base.cc
+++ b/quiche/quic/core/http/quic_spdy_client_session_base.cc
@@ -46,7 +46,8 @@
          num_outgoing_draining_streams() > 0;
 }
 
-bool QuicSpdyClientSessionBase::OnSettingsFrame(const SettingsFrame& frame) {
+bool QuicSpdyClientSessionBase::OnSettingsFrame(
+    const SettingsFrame& frame, absl::Span<const uint64_t> wire_order) {
   if (!was_zero_rtt_rejected()) {
     if (max_outbound_header_list_size() != std::numeric_limits<size_t>::max() &&
         frame.values.find(SETTINGS_MAX_FIELD_SECTION_SIZE) ==
@@ -79,7 +80,7 @@
     }
   }
 
-  if (!QuicSpdySession::OnSettingsFrame(frame)) {
+  if (!QuicSpdySession::OnSettingsFrame(frame, wire_order)) {
     return false;
   }
   std::string settings_frame = HttpEncoder::SerializeSettingsFrame(frame);
diff --git a/quiche/quic/core/http/quic_spdy_client_session_base.h b/quiche/quic/core/http/quic_spdy_client_session_base.h
index 59a7918..6e053fb 100644
--- a/quiche/quic/core/http/quic_spdy_client_session_base.h
+++ b/quiche/quic/core/http/quic_spdy_client_session_base.h
@@ -8,6 +8,7 @@
 #include <string>
 
 #include "absl/container/flat_hash_map.h"
+#include "absl/types/span.h"
 #include "quiche/quic/core/http/quic_spdy_session.h"
 #include "quiche/quic/core/quic_crypto_client_stream.h"
 #include "quiche/quic/platform/api/quic_export.h"
@@ -44,7 +45,8 @@
   bool ShouldKeepConnectionAlive() const override;
 
   // Override to serialize the settings and pass it down to the handshaker.
-  bool OnSettingsFrame(const SettingsFrame& frame) override;
+  bool OnSettingsFrame(const SettingsFrame& frame,
+                       absl::Span<const uint64_t> wire_order) override;
 };
 
 }  // namespace quic
diff --git a/quiche/quic/core/http/quic_spdy_client_session_test.cc b/quiche/quic/core/http/quic_spdy_client_session_test.cc
index d031542..4fbc90a 100644
--- a/quiche/quic/core/http/quic_spdy_client_session_test.cc
+++ b/quiche/quic/core/http/quic_spdy_client_session_test.cc
@@ -184,7 +184,7 @@
       settings.values[SETTINGS_QPACK_MAX_TABLE_CAPACITY] = 2;
       settings.values[SETTINGS_MAX_FIELD_SECTION_SIZE] = 5;
       settings.values[256] = 4;  // unknown setting
-      session_->OnSettingsFrame(settings);
+      session_->OnSettingsFrame(settings, /*wire_order=*/{});
     }
   }
 
@@ -573,7 +573,7 @@
                               0x04};
   ApplicationState expected(std::begin(application_state),
                             std::end(application_state));
-  session_->OnSettingsFrame(settings);
+  session_->OnSettingsFrame(settings, /*wire_order=*/{});
   EXPECT_EQ(expected, *client_session_cache_
                            ->Lookup(QuicServerId(kServerHostname, kPort),
                                     session_->GetClock()->WallNow(), nullptr)
@@ -664,7 +664,7 @@
     settings.values[SETTINGS_QPACK_MAX_TABLE_CAPACITY] = 2;
     settings.values[SETTINGS_MAX_FIELD_SECTION_SIZE] = 5;
     settings.values[256] = 4;  // unknown setting
-    session_->OnSettingsFrame(settings);
+    session_->OnSettingsFrame(settings, /*wire_order=*/{});
   }
 }
 
@@ -881,7 +881,7 @@
   settings.values[SETTINGS_QPACK_MAX_TABLE_CAPACITY] = 1;
   settings.values[SETTINGS_MAX_FIELD_SECTION_SIZE] = 5;
   settings.values[256] = 4;  // unknown setting
-  session_->OnSettingsFrame(settings);
+  session_->OnSettingsFrame(settings, /*wire_order=*/{});
 }
 
 TEST_P(QuicSpdyClientSessionTest, BadSettingsInZeroRttRejection) {
@@ -912,7 +912,7 @@
   // setting on SETTINGS_MAX_FIELD_SECTION_SIZE is reduced.
   settings.values[SETTINGS_MAX_FIELD_SECTION_SIZE] = 4;
   settings.values[256] = 4;  // unknown setting
-  session_->OnSettingsFrame(settings);
+  session_->OnSettingsFrame(settings, /*wire_order=*/{});
 }
 
 TEST_P(QuicSpdyClientSessionTest, ServerAcceptsZeroRttButOmitSetting) {
@@ -937,7 +937,7 @@
   // Intentionally omit SETTINGS_MAX_FIELD_SECTION_SIZE which was previously
   // sent with a non-zero value.
   settings.values[256] = 4;  // unknown setting
-  session_->OnSettingsFrame(settings);
+  session_->OnSettingsFrame(settings, /*wire_order=*/{});
 }
 
 }  // namespace
diff --git a/quiche/quic/core/http/quic_spdy_session.cc b/quiche/quic/core/http/quic_spdy_session.cc
index 4f9ed30..6784ef4 100644
--- a/quiche/quic/core/http/quic_spdy_session.cc
+++ b/quiche/quic/core/http/quic_spdy_session.cc
@@ -18,6 +18,7 @@
 #include "absl/strings/numbers.h"
 #include "absl/strings/str_cat.h"
 #include "absl/strings/string_view.h"
+#include "absl/types/span.h"
 #include "quiche/http2/core/http2_frame_decoder_adapter.h"
 #include "quiche/quic/core/crypto/crypto_protocol.h"
 #include "quiche/quic/core/http/http_constants.h"
@@ -93,7 +94,8 @@
   bool OnSettingsFrameStart(QuicByteCount /*header_length*/) override {
     return true;
   }
-  bool OnSettingsFrame(const SettingsFrame& frame) override {
+  bool OnSettingsFrame(const SettingsFrame& frame,
+                       absl::Span<const uint64_t> /*wire_order*/) override {
     if (settings_frame_received_via_alps_) {
       error_detail_ = "multiple SETTINGS frames";
       return false;
@@ -1104,7 +1106,8 @@
   }
 }
 
-bool QuicSpdySession::OnSettingsFrame(const SettingsFrame& frame) {
+bool QuicSpdySession::OnSettingsFrame(
+    const SettingsFrame& frame, absl::Span<const uint64_t> /*wire_order*/) {
   QUICHE_DCHECK(VersionIsIetfQuic(transport_version()));
   if (debug_visitor_ != nullptr) {
     debug_visitor_->OnSettingsFrameReceived(frame);
diff --git a/quiche/quic/core/http/quic_spdy_session.h b/quiche/quic/core/http/quic_spdy_session.h
index a38d976..e2697d5 100644
--- a/quiche/quic/core/http/quic_spdy_session.h
+++ b/quiche/quic/core/http/quic_spdy_session.h
@@ -15,6 +15,7 @@
 #include "absl/container/flat_hash_map.h"
 #include "absl/container/flat_hash_set.h"
 #include "absl/strings/string_view.h"
+#include "absl/types/span.h"
 #include "quiche/http2/core/http2_frame_decoder_adapter.h"
 #include "quiche/quic/core/http/http_frames.h"
 #include "quiche/quic/core/http/quic_header_list.h"
@@ -263,10 +264,13 @@
 
   const QuicHeadersStream* headers_stream() const { return headers_stream_; }
 
-  // Called when the control stream receives HTTP/3 SETTINGS.
-  // Returns false in case of 0-RTT if received settings are incompatible with
-  // cached values, true otherwise.
-  virtual bool OnSettingsFrame(const SettingsFrame& frame);
+  // Called when the control stream receives HTTP/3 SETTINGS. |wire_order|
+  // holds the setting identifiers in the order they appeared on the wire
+  // (SettingsFrame::values is unordered) and is only valid for the duration of
+  // the call. Returns false in case of 0-RTT if received settings are
+  // incompatible with cached values, true otherwise.
+  virtual bool OnSettingsFrame(const SettingsFrame& frame,
+                               absl::Span<const uint64_t> wire_order);
 
   // Called when an HTTP/3 SETTINGS frame is received via ALPS.
   // Returns an error message if an error has occurred, or nullopt otherwise.
diff --git a/quiche/quic/core/http/quic_spdy_session_test.cc b/quiche/quic/core/http/quic_spdy_session_test.cc
index 8958d41..a320379 100644
--- a/quiche/quic/core/http/quic_spdy_session_test.cc
+++ b/quiche/quic/core/http/quic_spdy_session_test.cc
@@ -3753,7 +3753,7 @@
 
   EXPECT_CALL(*connection_,
               CloseConnection(QUIC_HTTP_RECEIVE_SPDY_SETTING, _, _));
-  session_->OnSettingsFrame(frame);
+  session_->OnSettingsFrame(frame, /*wire_order=*/{});
 }
 
 TEST_P(QuicSpdySessionTestClient, ReceiveAcceptChFrame) {
diff --git a/quiche/quic/core/http/quic_spdy_stream.cc b/quiche/quic/core/http/quic_spdy_stream.cc
index d57236f..c67c241 100644
--- a/quiche/quic/core/http/quic_spdy_stream.cc
+++ b/quiche/quic/core/http/quic_spdy_stream.cc
@@ -16,6 +16,7 @@
 #include "absl/strings/numbers.h"
 #include "absl/strings/str_cat.h"
 #include "absl/strings/string_view.h"
+#include "absl/types/span.h"
 #include "quiche/http2/adapter/header_validator.h"
 #include "quiche/http2/core/http2_constants.h"
 #include "quiche/http2/core/spdy_protocol.h"
@@ -81,7 +82,8 @@
     return false;
   }
 
-  bool OnSettingsFrame(const SettingsFrame& /*frame*/) override {
+  bool OnSettingsFrame(const SettingsFrame& /*frame*/,
+                       absl::Span<const uint64_t> /*wire_order*/) override {
     CloseConnectionOnWrongFrame("Settings");
     return false;
   }
diff --git a/quiche/quic/core/http/quic_spdy_stream_test.cc b/quiche/quic/core/http/quic_spdy_stream_test.cc
index 048340e..343687f 100644
--- a/quiche/quic/core/http/quic_spdy_stream_test.cc
+++ b/quiche/quic/core/http/quic_spdy_stream_test.cc
@@ -3497,7 +3497,7 @@
   // Support WebTransport locally, but not by the peer.
   session_->set_local_http_datagram_support(HttpDatagramSupport::kRfc);
   session_->EnableWebTransport();
-  session_->OnSettingsFrame(SettingsFrame());
+  session_->OnSettingsFrame(SettingsFrame(), /*wire_order=*/{});
 
   StrictMock<MockHttp3DebugVisitor> debug_visitor;
   session_->set_debug_visitor(&debug_visitor);
@@ -3524,7 +3524,7 @@
   SettingsFrame settings;
   settings.values[SETTINGS_WEBTRANS_MAX_SESSIONS_DRAFT07] = 10;
   settings.values[SETTINGS_H3_DATAGRAM] = 1;
-  session_->OnSettingsFrame(settings);
+  session_->OnSettingsFrame(settings, /*wire_order=*/{});
 
   std::string webtransport_stream_frame;
   ASSERT_TRUE(absl::HexStringToBytes("404110", &webtransport_stream_frame));
@@ -3547,7 +3547,7 @@
   SettingsFrame settings;
   settings.values[SETTINGS_WEBTRANS_DRAFT00] = 1;
   settings.values[SETTINGS_H3_DATAGRAM] = 1;
-  session_->OnSettingsFrame(settings);
+  session_->OnSettingsFrame(settings, /*wire_order=*/{});
 
   std::string webtransport_stream_frame;
   ASSERT_TRUE(absl::HexStringToBytes("2100404110", &webtransport_stream_frame));
@@ -3570,7 +3570,7 @@
   SettingsFrame settings;
   settings.values[SETTINGS_WEBTRANS_MAX_SESSIONS_DRAFT07] = 10;
   settings.values[SETTINGS_H3_DATAGRAM] = 1;
-  session_->OnSettingsFrame(settings);
+  session_->OnSettingsFrame(settings, /*wire_order=*/{});
 
   std::string webtransport_stream_frame;
   ASSERT_TRUE(absl::HexStringToBytes("2100404110", &webtransport_stream_frame));
@@ -3670,7 +3670,7 @@
   session_->set_local_http_datagram_support(HttpDatagramSupport::kRfc);
   SettingsFrame settings;
   settings.values[SETTINGS_H3_DATAGRAM] = 0;
-  session_->OnSettingsFrame(settings);
+  session_->OnSettingsFrame(settings, /*wire_order=*/{});
 
   std::string http_datagram_payload = {1, 2, 3, 4, 5, 6};
   EXPECT_EQ(stream_->SendHttp3Datagram(http_datagram_payload),
diff --git a/quiche/quic/core/http/web_transport_only_server_session.cc b/quiche/quic/core/http/web_transport_only_server_session.cc
index 55b90d5..e778630 100644
--- a/quiche/quic/core/http/web_transport_only_server_session.cc
+++ b/quiche/quic/core/http/web_transport_only_server_session.cc
@@ -92,8 +92,8 @@
 }
 
 bool WebTransportOnlyServerSession::OnSettingsFrame(
-    const SettingsFrame& frame) {
-  if (!QuicServerSessionBase::OnSettingsFrame(frame)) {
+    const SettingsFrame& frame, absl::Span<const uint64_t> wire_order) {
+  if (!QuicServerSessionBase::OnSettingsFrame(frame, wire_order)) {
     return false;
   }
   if (!SupportsWebTransport()) {
diff --git a/quiche/quic/core/http/web_transport_only_server_session.h b/quiche/quic/core/http/web_transport_only_server_session.h
index fe9ebf8..b46c71e 100644
--- a/quiche/quic/core/http/web_transport_only_server_session.h
+++ b/quiche/quic/core/http/web_transport_only_server_session.h
@@ -80,7 +80,8 @@
   std::unique_ptr<QuicCryptoServerStreamBase> CreateQuicCryptoServerStream(
       const QuicCryptoServerConfig* crypto_config,
       QuicCompressedCertsCache* compressed_certs_cache) override;
-  bool OnSettingsFrame(const SettingsFrame& frame) override;
+  bool OnSettingsFrame(const SettingsFrame& frame,
+                       absl::Span<const uint64_t> wire_order) override;
 
   QuicSpdyStream* CreateIncomingStream(QuicStreamId id) override;
   QuicSpdyStream* CreateOutgoingBidirectionalStream() override;
diff --git a/quiche/quic/masque/masque_client_session.cc b/quiche/quic/masque/masque_client_session.cc
index 1dbc686..5eea086 100644
--- a/quiche/quic/masque/masque_client_session.cc
+++ b/quiche/quic/masque/masque_client_session.cc
@@ -592,9 +592,10 @@
   QuicSpdyClientSession::OnStreamClosed(stream_id);
 }
 
-bool MasqueClientSession::OnSettingsFrame(const SettingsFrame& frame) {
+bool MasqueClientSession::OnSettingsFrame(
+    const SettingsFrame& frame, absl::Span<const uint64_t> wire_order) {
   QUIC_DLOG(INFO) << connection_id() << " Received SETTINGS: " << frame;
-  if (!QuicSpdyClientSession::OnSettingsFrame(frame)) {
+  if (!QuicSpdyClientSession::OnSettingsFrame(frame, wire_order)) {
     QUIC_DLOG(ERROR) << "Failed to parse received settings";
     return false;
   }
diff --git a/quiche/quic/masque/masque_client_session.h b/quiche/quic/masque/masque_client_session.h
index 89765f7..ce97502 100644
--- a/quiche/quic/masque/masque_client_session.h
+++ b/quiche/quic/masque/masque_client_session.h
@@ -12,6 +12,7 @@
 
 #include "absl/container/flat_hash_map.h"
 #include "absl/strings/string_view.h"
+#include "absl/types/span.h"
 #include "quiche/quic/core/crypto/quic_crypto_client_config.h"
 #include "quiche/quic/core/frames/quic_connection_close_frame.h"
 #include "quiche/quic/core/http/http_frames.h"
@@ -141,7 +142,8 @@
   void OnStreamClosed(QuicStreamId stream_id) override;
 
   // From QuicSpdySession.
-  bool OnSettingsFrame(const SettingsFrame& frame) override;
+  bool OnSettingsFrame(const SettingsFrame& frame,
+                       absl::Span<const uint64_t> wire_order) override;
 
   // Send encapsulated UDP packet. |packet| contains the UDP payload.
   void SendPacket(absl::string_view packet,
diff --git a/quiche/quic/masque/masque_server_session.cc b/quiche/quic/masque/masque_server_session.cc
index 85a0fdb..cf41c36 100644
--- a/quiche/quic/masque/masque_server_session.cc
+++ b/quiche/quic/masque/masque_server_session.cc
@@ -930,9 +930,10 @@
   return true;
 }
 
-bool MasqueServerSession::OnSettingsFrame(const SettingsFrame& frame) {
+bool MasqueServerSession::OnSettingsFrame(
+    const SettingsFrame& frame, absl::Span<const uint64_t> wire_order) {
   QUIC_DLOG(INFO) << "Received SETTINGS: " << frame;
-  if (!QuicSimpleServerSession::OnSettingsFrame(frame)) {
+  if (!QuicSimpleServerSession::OnSettingsFrame(frame, wire_order)) {
     return false;
   }
   if (!SupportsH3Datagram()) {
diff --git a/quiche/quic/masque/masque_server_session.h b/quiche/quic/masque/masque_server_session.h
index 7845a30..9d0296d 100644
--- a/quiche/quic/masque/masque_server_session.h
+++ b/quiche/quic/masque/masque_server_session.h
@@ -13,6 +13,7 @@
 #include <memory>
 
 #include "absl/strings/string_view.h"
+#include "absl/types/span.h"
 #include "quiche/quic/core/crypto/quic_compressed_certs_cache.h"
 #include "quiche/quic/core/crypto/quic_crypto_server_config.h"
 #include "quiche/quic/core/frames/quic_connection_close_frame.h"
@@ -245,7 +246,8 @@
   };
 
   // From QuicSpdySession.
-  bool OnSettingsFrame(const SettingsFrame& frame) override;
+  bool OnSettingsFrame(const SettingsFrame& frame,
+                       absl::Span<const uint64_t> wire_order) override;
   HttpDatagramSupport LocalHttpDatagramSupport() override {
     return HttpDatagramSupport::kRfc;
   }
diff --git a/quiche/quic/test_tools/quic_test_utils.h b/quiche/quic/test_tools/quic_test_utils.h
index 3dd42f8..ff96e6e 100644
--- a/quiche/quic/test_tools/quic_test_utils.h
+++ b/quiche/quic/test_tools/quic_test_utils.h
@@ -20,6 +20,7 @@
 #include "absl/strings/str_cat.h"
 #include "absl/strings/string_view.h"
 #include "absl/synchronization/mutex.h"
+#include "absl/types/span.h"
 #include "quiche/quic/core/congestion_control/loss_detection_interface.h"
 #include "quiche/quic/core/congestion_control/send_algorithm_interface.h"
 #include "quiche/quic/core/crypto/transport_parameters.h"
@@ -1504,7 +1505,10 @@
   MOCK_METHOD(bool, OnGoAwayFrame, (const GoAwayFrame& frame), (override));
   MOCK_METHOD(bool, OnSettingsFrameStart, (QuicByteCount header_length),
               (override));
-  MOCK_METHOD(bool, OnSettingsFrame, (const SettingsFrame& frame), (override));
+  MOCK_METHOD(bool, OnSettingsFrame,
+              (const SettingsFrame& frame,
+               absl::Span<const uint64_t> wire_order),
+              (override));
 
   MOCK_METHOD(bool, OnDataFrameStart,
               (QuicByteCount header_length, QuicByteCount payload_length),