Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Unified Diff: net/quic/core/quic_spdy_stream.cc

Issue 2462823002: Deletes dead code. (Closed)
Patch Set: Updated patchset dependency Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/quic_spdy_stream.h ('k') | net/quic/core/quic_spdy_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_spdy_stream.cc
diff --git a/net/quic/core/quic_spdy_stream.cc b/net/quic/core/quic_spdy_stream.cc
index 502145c66de315a6500f3412cbd1ad03535c73bb..2e743f7c66383fc92868410ae0cab86576f3acc8 100644
--- a/net/quic/core/quic_spdy_stream.cc
+++ b/net/quic/core/quic_spdy_stream.cc
@@ -146,21 +146,7 @@ bool QuicSpdyStream::IsDoneReading() const {
}
bool QuicSpdyStream::HasBytesToRead() const {
- bool headers_to_read = !decompressed_headers_.empty();
- bool body_to_read = sequencer()->HasBytesToRead();
- bool trailers_to_read = !decompressed_trailers_.empty();
- return headers_to_read || body_to_read || trailers_to_read;
-}
-
-void QuicSpdyStream::MarkHeadersConsumed(size_t bytes_consumed) {
- decompressed_headers_.erase(0, bytes_consumed);
- if (FinishedReadingHeaders()) {
- sequencer()->SetUnblocked();
- }
-}
-
-void QuicSpdyStream::MarkTrailersConsumed(size_t bytes_consumed) {
- decompressed_trailers_.erase(0, bytes_consumed);
+ return sequencer()->HasBytesToRead();
}
void QuicSpdyStream::MarkTrailersConsumed() {
@@ -180,28 +166,11 @@ void QuicSpdyStream::SetPriority(SpdyPriority priority) {
priority_ = priority;
}
-void QuicSpdyStream::OnStreamHeaders(StringPiece headers_data) {
- if (!headers_decompressed_) {
- headers_data.AppendToString(&decompressed_headers_);
- } else {
- DCHECK(!trailers_decompressed_);
- headers_data.AppendToString(&decompressed_trailers_);
- }
-}
-
void QuicSpdyStream::OnStreamHeadersPriority(SpdyPriority priority) {
DCHECK_EQ(Perspective::IS_SERVER, session()->connection()->perspective());
SetPriority(priority);
}
-void QuicSpdyStream::OnStreamHeadersComplete(bool fin, size_t frame_len) {
- if (!headers_decompressed_) {
- OnInitialHeadersComplete(fin, frame_len);
- } else {
- OnTrailingHeadersComplete(fin, frame_len);
- }
-}
-
void QuicSpdyStream::OnStreamHeaderList(bool fin,
size_t frame_len,
const QuicHeaderList& header_list) {
@@ -209,6 +178,8 @@ void QuicSpdyStream::OnStreamHeaderList(bool fin,
// if the current headers are too large. So if the list is empty here
// then the headers list must have been too large, and the stream should
// be reset.
+ // TODO(rch): Use an explicit "headers too large" signal. An empty header list
+ // might be acceptable if it corresponds to a trailing header frame.
if (FLAGS_quic_limit_uncompressed_headers && header_list.empty()) {
OnHeadersTooLarge();
if (IsDoneReading()) {
@@ -226,16 +197,6 @@ void QuicSpdyStream::OnHeadersTooLarge() {
Reset(QUIC_HEADERS_TOO_LARGE);
}
-void QuicSpdyStream::OnInitialHeadersComplete(bool fin, size_t /*frame_len*/) {
- headers_decompressed_ = true;
- if (fin) {
- OnStreamFrame(QuicStreamFrame(id(), fin, 0, StringPiece()));
- }
- if (FinishedReadingHeaders()) {
- sequencer()->SetUnblocked();
- }
-}
-
void QuicSpdyStream::OnInitialHeadersComplete(
bool fin,
size_t /*frame_len*/,
@@ -250,21 +211,6 @@ void QuicSpdyStream::OnInitialHeadersComplete(
}
}
-void QuicSpdyStream::OnPromiseHeaders(StringPiece headers_data) {
- headers_data.AppendToString(&decompressed_headers_);
-}
-
-void QuicSpdyStream::OnPromiseHeadersComplete(
- QuicStreamId /* promised_stream_id */,
- size_t /* frame_len */) {
- // To be overridden in QuicSpdyClientStream. Not supported on
- // server side.
- session()->connection()->CloseConnection(
- QUIC_INVALID_HEADERS_STREAM_DATA, "Promise headers received by server",
- ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
- return;
-}
-
void QuicSpdyStream::OnPromiseHeaderList(
QuicStreamId /* promised_id */,
size_t /* frame_len */,
@@ -277,41 +223,6 @@ void QuicSpdyStream::OnPromiseHeaderList(
return;
}
-void QuicSpdyStream::OnTrailingHeadersComplete(bool fin, size_t /*frame_len*/) {
- DCHECK(!trailers_decompressed_);
- if (fin_received()) {
- DLOG(ERROR) << "Received Trailers after FIN, on stream: " << id();
- session()->connection()->CloseConnection(
- QUIC_INVALID_HEADERS_STREAM_DATA, "Trailers after fin",
- ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
- return;
- }
- if (!fin) {
- DLOG(ERROR) << "Trailers must have FIN set, on stream: " << id();
- session()->connection()->CloseConnection(
- QUIC_INVALID_HEADERS_STREAM_DATA, "Fin missing from trailers",
- ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
- return;
- }
-
- size_t final_byte_offset = 0;
- if (!SpdyUtils::ParseTrailers(decompressed_trailers().data(),
- decompressed_trailers().length(),
- &final_byte_offset, &received_trailers_)) {
- DLOG(ERROR) << "Trailers are malformed: " << id();
- session()->connection()->CloseConnection(
- QUIC_INVALID_HEADERS_STREAM_DATA, "Trailers are malformed",
- ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
- return;
- }
-
- // The data on this stream ends at |final_byte_offset|.
- DVLOG(1) << "Stream ends at byte offset: " << final_byte_offset
- << " currently read: " << stream_bytes_read();
- trailers_decompressed_ = true;
- OnStreamFrame(QuicStreamFrame(id(), fin, final_byte_offset, StringPiece()));
-}
-
void QuicSpdyStream::OnTrailingHeadersComplete(
bool fin,
size_t /*frame_len*/,
@@ -379,8 +290,7 @@ void QuicSpdyStream::OnCanWrite() {
}
bool QuicSpdyStream::FinishedReadingHeaders() const {
- return headers_decompressed_ && decompressed_headers_.empty() &&
- header_list_.empty();
+ return headers_decompressed_ && header_list_.empty();
}
bool QuicSpdyStream::ParseHeaderStatusCode(const SpdyHeaderBlock& header,
@@ -412,7 +322,7 @@ bool QuicSpdyStream::FinishedReadingTrailers() const {
} else if (!trailers_decompressed_) {
return true;
} else {
- return trailers_consumed_ && decompressed_trailers_.empty();
+ return trailers_consumed_;
}
}
« no previous file with comments | « net/quic/core/quic_spdy_stream.h ('k') | net/quic/core/quic_spdy_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698