Add `payload_length` argument to SpdyFramerVisitorInterface::OnContinuation(). This change is analogous to the `payload_length` addition to SpdyFramerVisitorInterface::OnHeaders() in cl/449251987. The goal is to use the new `payload_length` argument in recording the header bytes for Dapper annotations. PiperOrigin-RevId: 450006121
diff --git a/quiche/http2/adapter/event_forwarder.cc b/quiche/http2/adapter/event_forwarder.cc index a18a2cd..716e6bb 100644 --- a/quiche/http2/adapter/event_forwarder.cc +++ b/quiche/http2/adapter/event_forwarder.cc
@@ -141,9 +141,10 @@ } } -void EventForwarder::OnContinuation(spdy::SpdyStreamId stream_id, bool end) { +void EventForwarder::OnContinuation(spdy::SpdyStreamId stream_id, + size_t payload_length, bool end) { if (can_forward_()) { - receiver_.OnContinuation(stream_id, end); + receiver_.OnContinuation(stream_id, payload_length, end); } }
diff --git a/quiche/http2/adapter/event_forwarder.h b/quiche/http2/adapter/event_forwarder.h index 5f93db0..1147162 100644 --- a/quiche/http2/adapter/event_forwarder.h +++ b/quiche/http2/adapter/event_forwarder.h
@@ -54,7 +54,8 @@ int delta_window_size) override; void OnPushPromise(spdy::SpdyStreamId stream_id, spdy::SpdyStreamId promised_stream_id, bool end) override; - void OnContinuation(spdy::SpdyStreamId stream_id, bool end) override; + void OnContinuation(spdy::SpdyStreamId stream_id, size_t payload_length, + bool end) override; void OnAltSvc(spdy::SpdyStreamId stream_id, absl::string_view origin, const spdy::SpdyAltSvcWireFormat::AlternativeServiceVector& altsvc_vector) override;
diff --git a/quiche/http2/adapter/event_forwarder_test.cc b/quiche/http2/adapter/event_forwarder_test.cc index c3680c8..a3d3bf6 100644 --- a/quiche/http2/adapter/event_forwarder_test.cc +++ b/quiche/http2/adapter/event_forwarder_test.cc
@@ -104,8 +104,10 @@ EXPECT_CALL(receiver, OnPushPromise(stream_id, stream_id + 1, /*end=*/true)); event_forwarder.OnPushPromise(stream_id, stream_id + 1, /*end=*/true); - EXPECT_CALL(receiver, OnContinuation(stream_id, /*end=*/true)); - event_forwarder.OnContinuation(stream_id, /*end=*/true); + EXPECT_CALL(receiver, + OnContinuation(stream_id, /*payload_length=*/42, /*end=*/true)); + event_forwarder.OnContinuation(stream_id, /*payload_length=*/42, + /*end=*/true); const spdy::SpdyAltSvcWireFormat::AlternativeServiceVector altsvc_vector; EXPECT_CALL(receiver, OnAltSvc(stream_id, some_data, altsvc_vector)); @@ -199,7 +201,8 @@ event_forwarder.OnPushPromise(stream_id, stream_id + 1, /*end=*/true); EXPECT_CALL(receiver, OnContinuation).Times(0); - event_forwarder.OnContinuation(stream_id, /*end=*/true); + event_forwarder.OnContinuation(stream_id, /*payload_length=*/42, + /*end=*/true); EXPECT_CALL(receiver, OnAltSvc).Times(0); const spdy::SpdyAltSvcWireFormat::AlternativeServiceVector altsvc_vector;
diff --git a/quiche/http2/adapter/oghttp2_session.cc b/quiche/http2/adapter/oghttp2_session.cc index 77fff36..c22f085 100644 --- a/quiche/http2/adapter/oghttp2_session.cc +++ b/quiche/http2/adapter/oghttp2_session.cc
@@ -1435,8 +1435,8 @@ ConnectionError::kInvalidPushPromise); } -void OgHttp2Session::OnContinuation(spdy::SpdyStreamId /*stream_id*/, bool - /*end*/) {} +void OgHttp2Session::OnContinuation(spdy::SpdyStreamId /*stream_id*/, + size_t /*payload_length*/, bool /*end*/) {} void OgHttp2Session::OnAltSvc(spdy::SpdyStreamId /*stream_id*/, absl::string_view /*origin*/,
diff --git a/quiche/http2/adapter/oghttp2_session.h b/quiche/http2/adapter/oghttp2_session.h index 5bc854b..678cc2f 100644 --- a/quiche/http2/adapter/oghttp2_session.h +++ b/quiche/http2/adapter/oghttp2_session.h
@@ -188,7 +188,8 @@ int delta_window_size) override; void OnPushPromise(spdy::SpdyStreamId stream_id, spdy::SpdyStreamId promised_stream_id, bool end) override; - void OnContinuation(spdy::SpdyStreamId stream_id, bool end) override; + void OnContinuation(spdy::SpdyStreamId stream_id, size_t payload_length, + bool end) override; void OnAltSvc(spdy::SpdyStreamId /*stream_id*/, absl::string_view /*origin*/, const spdy::SpdyAltSvcWireFormat:: AlternativeServiceVector& /*altsvc_vector*/) override;
diff --git a/quiche/http2/core/http2_trace_logging.cc b/quiche/http2/core/http2_trace_logging.cc index 10ff163..554bd5c 100644 --- a/quiche/http2/core/http2_trace_logging.cc +++ b/quiche/http2/core/http2_trace_logging.cc
@@ -288,11 +288,12 @@ wrapped_->OnPushPromise(original_stream_id, promised_stream_id, end); } -void Http2TraceLogger::OnContinuation(SpdyStreamId stream_id, bool end) { +void Http2TraceLogger::OnContinuation(SpdyStreamId stream_id, + size_t payload_length, bool end) { HTTP2_TRACE_LOG(perspective_, is_enabled_) << "OnContinuation:" << FORMAT_ARG(connection_id_) - << FORMAT_ARG(stream_id) << FORMAT_ARG(end); - wrapped_->OnContinuation(stream_id, end); + << FORMAT_ARG(stream_id) << FORMAT_ARG(payload_length) << FORMAT_ARG(end); + wrapped_->OnContinuation(stream_id, payload_length, end); } void Http2TraceLogger::OnAltSvc(
diff --git a/quiche/http2/core/http2_trace_logging.h b/quiche/http2/core/http2_trace_logging.h index 1bde7ee..deeeee1 100644 --- a/quiche/http2/core/http2_trace_logging.h +++ b/quiche/http2/core/http2_trace_logging.h
@@ -77,7 +77,8 @@ void OnWindowUpdate(SpdyStreamId stream_id, int delta_window_size) override; void OnPushPromise(SpdyStreamId stream_id, SpdyStreamId promised_stream_id, bool end) override; - void OnContinuation(SpdyStreamId stream_id, bool end) override; + void OnContinuation(SpdyStreamId stream_id, size_t payload_length, + bool end) override; void OnAltSvc(SpdyStreamId stream_id, absl::string_view origin, const SpdyAltSvcWireFormat::AlternativeServiceVector& altsvc_vector) override;
diff --git a/quiche/quic/core/http/quic_headers_stream_test.cc b/quiche/quic/core/http/quic_headers_stream_test.cc index 9b8ffb4..76083f3 100644 --- a/quiche/quic/core/http/quic_headers_stream_test.cc +++ b/quiche/quic/core/http/quic_headers_stream_test.cc
@@ -111,7 +111,8 @@ (SpdyStreamId stream_id, SpdyStreamId promised_stream_id, bool end), (override)); - MOCK_METHOD(void, OnContinuation, (SpdyStreamId stream_id, bool end), + MOCK_METHOD(void, OnContinuation, + (SpdyStreamId stream_id, size_t payload_size, bool end), (override)); MOCK_METHOD( void, OnAltSvc,
diff --git a/quiche/quic/core/http/quic_spdy_session.cc b/quiche/quic/core/http/quic_spdy_session.cc index f0aa6d5..e54c846 100644 --- a/quiche/quic/core/http/quic_spdy_session.cc +++ b/quiche/quic/core/http/quic_spdy_session.cc
@@ -363,7 +363,8 @@ session_->OnPushPromise(stream_id, promised_stream_id); } - void OnContinuation(SpdyStreamId /*stream_id*/, bool /*end*/) override {} + void OnContinuation(SpdyStreamId /*stream_id*/, size_t /*payload_size*/, + bool /*end*/) override {} void OnPriority(SpdyStreamId stream_id, SpdyStreamId /* parent_id */, int weight, bool /* exclusive */) override {
diff --git a/quiche/spdy/core/http2_frame_decoder_adapter.cc b/quiche/spdy/core/http2_frame_decoder_adapter.cc index 780342e..89ea6e8 100644 --- a/quiche/spdy/core/http2_frame_decoder_adapter.cc +++ b/quiche/spdy/core/http2_frame_decoder_adapter.cc
@@ -506,7 +506,8 @@ frame_header_ = header; has_frame_header_ = true; ReportReceiveCompressedFrame(header); - visitor()->OnContinuation(header.stream_id, header.IsEndHeaders()); + visitor()->OnContinuation(header.stream_id, header.payload_length, + header.IsEndHeaders()); } }
diff --git a/quiche/spdy/core/http2_frame_decoder_adapter.h b/quiche/spdy/core/http2_frame_decoder_adapter.h index fbdfd5b..e0dfbd9 100644 --- a/quiche/spdy/core/http2_frame_decoder_adapter.h +++ b/quiche/spdy/core/http2_frame_decoder_adapter.h
@@ -485,7 +485,12 @@ // Called when a CONTINUATION frame is received. // Note that header block data is not included. See OnHeaderFrameStart(). - virtual void OnContinuation(SpdyStreamId stream_id, bool end) = 0; + // |stream_id| The stream receiving the CONTINUATION. + // |payload_length| The length of the payload in this CONTINUATION frame. + // |end| True if this CONTINUATION frame will not be followed by another + // CONTINUATION frame. + virtual void OnContinuation(SpdyStreamId stream_id, size_t payload_length, + bool end) = 0; // Called when an ALTSVC frame has been parsed. virtual void OnAltSvc(
diff --git a/quiche/spdy/core/spdy_framer_test.cc b/quiche/spdy/core/spdy_framer_test.cc index 1b3c421..909f43a 100644 --- a/quiche/spdy/core/spdy_framer_test.cc +++ b/quiche/spdy/core/spdy_framer_test.cc
@@ -387,8 +387,10 @@ last_push_promise_promised_stream_ = promised_stream_id; } - void OnContinuation(SpdyStreamId stream_id, bool end) override { - QUICHE_VLOG(1) << "OnContinuation(" << stream_id << ", " << end << ")"; + void OnContinuation(SpdyStreamId stream_id, size_t payload_size, + bool end) override { + QUICHE_VLOG(1) << "OnContinuation(" << stream_id << ", " << payload_size + << ", " << end << ")"; ++continuation_count_; } @@ -4368,7 +4370,8 @@ EXPECT_CALL(debug_visitor, OnReceiveCompressedFrame(42, SpdyFrameType::CONTINUATION, _)); EXPECT_CALL(visitor, OnCommonHeader(42, _, 0x9, flags)); - EXPECT_CALL(visitor, OnContinuation(42, flags & HEADERS_FLAG_END_HEADERS)); + EXPECT_CALL(visitor, + OnContinuation(42, _, flags & HEADERS_FLAG_END_HEADERS)); bool end = flags & HEADERS_FLAG_END_HEADERS; if (end) { EXPECT_CALL(visitor, OnHeaderFrameEnd(42)).Times(1);
diff --git a/quiche/spdy/core/spdy_no_op_visitor.h b/quiche/spdy/core/spdy_no_op_visitor.h index 3bb47be..78fe2d1 100644 --- a/quiche/spdy/core/spdy_no_op_visitor.h +++ b/quiche/spdy/core/spdy_no_op_visitor.h
@@ -55,7 +55,8 @@ void OnPushPromise(SpdyStreamId /*stream_id*/, SpdyStreamId /*promised_stream_id*/, bool /*end*/) override {} - void OnContinuation(SpdyStreamId /*stream_id*/, bool /*end*/) override {} + void OnContinuation(SpdyStreamId /*stream_id*/, size_t /*payload_size*/, + bool /*end*/) override {} void OnAltSvc(SpdyStreamId /*stream_id*/, absl::string_view /*origin*/, const SpdyAltSvcWireFormat::AlternativeServiceVector& /*altsvc_vector*/) override {}
diff --git a/quiche/spdy/test_tools/mock_spdy_framer_visitor.h b/quiche/spdy/test_tools/mock_spdy_framer_visitor.h index 5d721c6..373a2db 100644 --- a/quiche/spdy/test_tools/mock_spdy_framer_visitor.h +++ b/quiche/spdy/test_tools/mock_spdy_framer_visitor.h
@@ -69,7 +69,8 @@ (SpdyStreamId stream_id, SpdyStreamId promised_stream_id, bool end), (override)); - MOCK_METHOD(void, OnContinuation, (SpdyStreamId stream_id, bool end), + MOCK_METHOD(void, OnContinuation, + (SpdyStreamId stream_id, size_t payload_length, bool end), (override)); MOCK_METHOD( void, OnAltSvc,