Remove unused PushId and struct MaxPushIdFrame.
PiperOrigin-RevId: 442575091
diff --git a/quiche/quic/core/http/http_decoder.cc b/quiche/quic/core/http/http_decoder.cc
index 0008d14..5845a37 100644
--- a/quiche/quic/core/http/http_decoder.cc
+++ b/quiche/quic/core/http/http_decoder.cc
@@ -528,8 +528,8 @@
return visitor_->OnGoAwayFrame(frame);
}
case static_cast<uint64_t>(HttpFrameType::MAX_PUSH_ID): {
- MaxPushIdFrame frame;
- if (!reader->ReadVarInt62(&frame.push_id)) {
+ uint64_t unused;
+ if (!reader->ReadVarInt62(&unused)) {
RaiseError(QUIC_HTTP_FRAME_ERROR,
"Unable to read MAX_PUSH_ID push_id.");
return false;
@@ -539,7 +539,7 @@
"Superfluous data in MAX_PUSH_ID frame.");
return false;
}
- return visitor_->OnMaxPushIdFrame(frame);
+ return visitor_->OnMaxPushIdFrame();
}
case static_cast<uint64_t>(HttpFrameType::PRIORITY_UPDATE_REQUEST_STREAM): {
PriorityUpdateFrame frame;
diff --git a/quiche/quic/core/http/http_decoder.h b/quiche/quic/core/http/http_decoder.h
index 137755e..ac68276 100644
--- a/quiche/quic/core/http/http_decoder.h
+++ b/quiche/quic/core/http/http_decoder.h
@@ -45,7 +45,7 @@
// processed. At that point it is safe to consume |header_length| bytes.
// Called when a MAX_PUSH_ID frame has been successfully parsed.
- virtual bool OnMaxPushIdFrame(const MaxPushIdFrame& frame) = 0;
+ virtual bool OnMaxPushIdFrame() = 0;
// Called when a GOAWAY frame has been successfully parsed.
virtual bool OnGoAwayFrame(const GoAwayFrame& frame) = 0;
diff --git a/quiche/quic/core/http/http_decoder_test.cc b/quiche/quic/core/http/http_decoder_test.cc
index f385410..5e3d6d6 100644
--- a/quiche/quic/core/http/http_decoder_test.cc
+++ b/quiche/quic/core/http/http_decoder_test.cc
@@ -45,8 +45,7 @@
// Called if an error is detected.
MOCK_METHOD(void, OnError, (HttpDecoder*), (override));
- MOCK_METHOD(bool, OnMaxPushIdFrame, (const MaxPushIdFrame& frame),
- (override));
+ MOCK_METHOD(bool, OnMaxPushIdFrame, (), (override));
MOCK_METHOD(bool, OnGoAwayFrame, (const GoAwayFrame& frame), (override));
MOCK_METHOD(bool, OnSettingsFrameStart, (QuicByteCount header_length),
(override));
@@ -90,7 +89,7 @@
class HttpDecoderTest : public QuicTest {
public:
HttpDecoderTest() : decoder_(&visitor_) {
- ON_CALL(visitor_, OnMaxPushIdFrame(_)).WillByDefault(Return(true));
+ 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));
@@ -230,20 +229,19 @@
"01"); // Push Id
// Visitor pauses processing.
- EXPECT_CALL(visitor_, OnMaxPushIdFrame(MaxPushIdFrame({1})))
- .WillOnce(Return(false));
+ EXPECT_CALL(visitor_, OnMaxPushIdFrame()).WillOnce(Return(false));
EXPECT_EQ(input.size(), ProcessInputWithGarbageAppended(input));
EXPECT_THAT(decoder_.error(), IsQuicNoError());
EXPECT_EQ("", decoder_.error_detail());
// Process the full frame.
- EXPECT_CALL(visitor_, OnMaxPushIdFrame(MaxPushIdFrame({1})));
+ EXPECT_CALL(visitor_, OnMaxPushIdFrame());
EXPECT_EQ(input.size(), ProcessInput(input));
EXPECT_THAT(decoder_.error(), IsQuicNoError());
EXPECT_EQ("", decoder_.error_detail());
// Process the frame incrementally.
- EXPECT_CALL(visitor_, OnMaxPushIdFrame(MaxPushIdFrame({1})));
+ EXPECT_CALL(visitor_, OnMaxPushIdFrame());
ProcessInputCharByChar(input);
EXPECT_THAT(decoder_.error(), IsQuicNoError());
EXPECT_EQ("", decoder_.error_detail());
diff --git a/quiche/quic/core/http/http_frames.h b/quiche/quic/core/http/http_frames.h
index eae52ee..b96c5fb 100644
--- a/quiche/quic/core/http/http_frames.h
+++ b/quiche/quic/core/http/http_frames.h
@@ -20,9 +20,6 @@
namespace quic {
-// TODO(b/171463363): Remove.
-using PushId = uint64_t;
-
enum class HttpFrameType {
DATA = 0x0,
HEADERS = 0x1,
@@ -101,18 +98,6 @@
bool operator==(const GoAwayFrame& rhs) const { return id == rhs.id; }
};
-// 7.2.7. MAX_PUSH_ID
-//
-// The MAX_PUSH_ID frame (type=0xD) is used by clients to control the
-// number of server pushes that the server can initiate.
-struct QUIC_EXPORT_PRIVATE MaxPushIdFrame {
- PushId push_id;
-
- bool operator==(const MaxPushIdFrame& rhs) const {
- return push_id == rhs.push_id;
- }
-};
-
// https://httpwg.org/http-extensions/draft-ietf-httpbis-priority.html
//
// The PRIORITY_UPDATE frame specifies the sender-advised priority of a stream.
diff --git a/quiche/quic/core/http/http_frames_test.cc b/quiche/quic/core/http/http_frames_test.cc
index 1eefd7e..446a6b9 100644
--- a/quiche/quic/core/http/http_frames_test.cc
+++ b/quiche/quic/core/http/http_frames_test.cc
@@ -44,17 +44,6 @@
EXPECT_TRUE(a == b);
}
-TEST(HttpFramesTest, MaxPushIdFrame) {
- MaxPushIdFrame a{1};
- EXPECT_TRUE(a == a);
-
- MaxPushIdFrame b{2};
- EXPECT_FALSE(a == b);
-
- b.push_id = 1;
- EXPECT_TRUE(a == b);
-}
-
TEST(HttpFramesTest, PriorityUpdateFrame) {
PriorityUpdateFrame a{REQUEST_STREAM, 0, ""};
EXPECT_TRUE(a == a);
diff --git a/quiche/quic/core/http/quic_receive_control_stream.cc b/quiche/quic/core/http/quic_receive_control_stream.cc
index 1eba8f5..c0a76af 100644
--- a/quiche/quic/core/http/quic_receive_control_stream.cc
+++ b/quiche/quic/core/http/quic_receive_control_stream.cc
@@ -62,8 +62,7 @@
stream_delegate()->OnStreamError(decoder->error(), decoder->error_detail());
}
-bool QuicReceiveControlStream::OnMaxPushIdFrame(
- const MaxPushIdFrame& /*frame*/) {
+bool QuicReceiveControlStream::OnMaxPushIdFrame() {
return ValidateFrameType(HttpFrameType::MAX_PUSH_ID);
}
diff --git a/quiche/quic/core/http/quic_receive_control_stream.h b/quiche/quic/core/http/quic_receive_control_stream.h
index 0cf34fa..71d0bf2 100644
--- a/quiche/quic/core/http/quic_receive_control_stream.h
+++ b/quiche/quic/core/http/quic_receive_control_stream.h
@@ -35,7 +35,7 @@
// HttpDecoder::Visitor implementation.
void OnError(HttpDecoder* decoder) override;
- bool OnMaxPushIdFrame(const MaxPushIdFrame& frame) override;
+ bool OnMaxPushIdFrame() override;
bool OnGoAwayFrame(const GoAwayFrame& frame) override;
bool OnSettingsFrameStart(QuicByteCount header_length) override;
bool OnSettingsFrame(const SettingsFrame& frame) override;
diff --git a/quiche/quic/core/http/quic_spdy_session.cc b/quiche/quic/core/http/quic_spdy_session.cc
index 58ce9ac..b90fba9 100644
--- a/quiche/quic/core/http/quic_spdy_session.cc
+++ b/quiche/quic/core/http/quic_spdy_session.cc
@@ -74,7 +74,7 @@
// HttpDecoder::Visitor implementation.
void OnError(HttpDecoder* /*decoder*/) override {}
- bool OnMaxPushIdFrame(const MaxPushIdFrame& /*frame*/) override {
+ bool OnMaxPushIdFrame() override {
error_detail_ = "MAX_PUSH_ID frame forbidden";
return false;
}
diff --git a/quiche/quic/core/http/quic_spdy_session_test.cc b/quiche/quic/core/http/quic_spdy_session_test.cc
index 8636a75..c625f49 100644
--- a/quiche/quic/core/http/quic_spdy_session_test.cc
+++ b/quiche/quic/core/http/quic_spdy_session_test.cc
@@ -1300,8 +1300,7 @@
}
EXPECT_FALSE(session_.goaway_received());
- PushId push_id1 = 0;
- session_.OnHttp3GoAway(push_id1);
+ session_.OnHttp3GoAway(/* id = */ 0);
EXPECT_TRUE(session_.goaway_received());
EXPECT_CALL(
@@ -1310,8 +1309,7 @@
QUIC_HTTP_GOAWAY_ID_LARGER_THAN_PREVIOUS,
"GOAWAY received with ID 1 greater than previously received ID 0",
_));
- PushId push_id2 = 1;
- session_.OnHttp3GoAway(push_id2);
+ session_.OnHttp3GoAway(/* id = */ 1);
}
// Test that server session will send a connectivity probe in response to a
diff --git a/quiche/quic/core/http/quic_spdy_stream.cc b/quiche/quic/core/http/quic_spdy_stream.cc
index 52df689..2a460c3 100644
--- a/quiche/quic/core/http/quic_spdy_stream.cc
+++ b/quiche/quic/core/http/quic_spdy_stream.cc
@@ -53,7 +53,7 @@
stream_->OnUnrecoverableError(decoder->error(), decoder->error_detail());
}
- bool OnMaxPushIdFrame(const MaxPushIdFrame& /*frame*/) override {
+ bool OnMaxPushIdFrame() override {
CloseConnectionOnWrongFrame("Max Push Id");
return false;
}