Change default QuicStream priority when using IETF QUIC.
This allows removal of MaybeSendPriorityUpdateFrame() call in
QuicSpdyStream::WriteHeaders(): if priority is default, no need to send
PRIORITY_UPDATE; if SetPriority() has been called, then PRIORITY_UPDATE has
already been sent.
gfe-relnote: n/a, change to QUIC v99-only code. Protected by existing disabled gfe2_reloadable_flag_quic_enable_version_99.
PiperOrigin-RevId: 292745471
Change-Id: Ic9fff95e6a1650a91449a659fbe156265f2b9cac
diff --git a/quic/core/quic_stream.h b/quic/core/quic_stream.h
index bd680f6..0688641 100644
--- a/quic/core/quic_stream.h
+++ b/quic/core/quic_stream.h
@@ -114,11 +114,15 @@
// This is somewhat arbitrary. It's possible, but unlikely, we will either
// fail to set a priority client-side, or cancel a stream before stripping the
// priority from the wire server-side. In either case, start out with a
- // priority in the middle.
+ // priority in the middle in case of Google QUIC.
static const spdy::SpdyPriority kDefaultPriority = 3;
static_assert(kDefaultPriority ==
(spdy::kV3LowestPriority + spdy::kV3HighestPriority) / 2,
"Unexpected value of kDefaultPriority");
+ // On the other hand, when using IETF QUIC, use the default value defined by
+ // the priority extension at
+ // https://httpwg.org/http-extensions/draft-ietf-httpbis-priority.html#default.
+ static const int kDefaultUrgency = 1;
// Creates a new stream with stream_id |id| associated with |session|. If
// |is_static| is true, then the stream will be given precedence
@@ -353,6 +357,9 @@
// Returns true if the stream is static.
bool is_static() const { return is_static_; }
+ static spdy::SpdyStreamPrecedence CalculateDefaultPriority(
+ const QuicSession* session);
+
protected:
// Close the read side of the socket. May cause the stream to be closed.
// Subclasses and consumers should use StopReading to terminate reading early