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

Unified Diff: net/quic/quic_spdy_stream.h

Issue 1518483003: QuicSpdyStream supports receiving trailing headers frames. Flag protected by FLAGS_quic_support_tra… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@clean
Patch Set: Created 5 years 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/quic_flags.cc ('k') | net/quic/quic_spdy_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_spdy_stream.h
diff --git a/net/quic/quic_spdy_stream.h b/net/quic/quic_spdy_stream.h
index 81673f7e369dd1a1edfd2c41b3a73ee8650fe094..b9d6797614cd7ad44581b1ca189d94a49ed1dccf 100644
--- a/net/quic/quic_spdy_stream.h
+++ b/net/quic/quic_spdy_stream.h
@@ -94,6 +94,9 @@ class NET_EXPORT_PRIVATE QuicSpdyStream : public ReliableQuicStream {
// Marks |bytes_consumed| of the headers data as consumed.
void MarkHeadersConsumed(size_t bytes_consumed);
+ // Marks |bytes_consumed| of the trailers data as consumed.
+ void MarkTrailersConsumed(size_t bytes_consumed);
+
// This block of functions wraps the sequencer's functions of the same
// name. These methods return uncompressed data until that has
// been fully processed. Then they simply delegate to the sequencer.
@@ -113,13 +116,25 @@ class NET_EXPORT_PRIVATE QuicSpdyStream : public ReliableQuicStream {
return decompressed_headers_;
}
+ bool trailers_decompressed() const { return trailers_decompressed_; }
+
+ const std::string& decompressed_trailers() const {
+ return decompressed_trailers_;
+ }
+
SpdyPriority priority() const { return priority_; }
protected:
+ // Called by OnStreamHeadersComplete depending on which type (initial or
+ // trailing) headers are expected next.
+ virtual void OnInitialHeadersComplete(bool fin, size_t frame_len);
+ virtual void OnTrailingHeadersComplete(bool fin, size_t frame_len);
+
// Sets priority_ to priority. This should only be called before bytes are
// written to the server.
void set_priority(SpdyPriority priority);
+ // Returns true if headers have been fully read and consumed.
bool FinishedReadingHeaders() const;
private:
@@ -127,6 +142,9 @@ class NET_EXPORT_PRIVATE QuicSpdyStream : public ReliableQuicStream {
friend class test::ReliableQuicStreamPeer;
friend class QuicStreamUtils;
+ // Returns true if trailers have been fully read and consumed.
+ bool FinishedReadingTrailers() const;
+
QuicSpdySession* spdy_session_;
Visitor* visitor_;
@@ -138,6 +156,12 @@ class NET_EXPORT_PRIVATE QuicSpdyStream : public ReliableQuicStream {
// via ProcessData or Readv.
std::string decompressed_headers_;
+ // True if the trailers have been completely decompressed.
+ bool trailers_decompressed_;
+ // Contains a copy of the decompressed trailers until they are consumed
+ // via ProcessData or Readv.
+ std::string decompressed_trailers_;
+
DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream);
};
« no previous file with comments | « net/quic/quic_flags.cc ('k') | net/quic/quic_spdy_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698