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

Unified Diff: net/quic/chromium/quic_http_stream.h

Issue 2777333002: Simplify the the logic for setting the final response status for a (Closed)
Patch Set: Rebase Created 3 years, 9 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 | « no previous file | net/quic/chromium/quic_http_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/chromium/quic_http_stream.h
diff --git a/net/quic/chromium/quic_http_stream.h b/net/quic/chromium/quic_http_stream.h
index bd1250e6d009f37c2dbd72e354c072865a325005..2ca5bbcfed78744500833c60e124fbd03c2a9bcf 100644
--- a/net/quic/chromium/quic_http_stream.h
+++ b/net/quic/chromium/quic_http_stream.h
@@ -135,6 +135,18 @@ class NET_EXPORT_PRIVATE QuicHttpStream
void ResetStream();
+ // If |has_response_status_| is false, sets |response_status| to the result
+ // of ComputeResponseStatus(). Returns |response_status_|.
+ int GetResponseStatus();
+ // Sets the result of |ComputeResponseStatus()| as the |response_status_|.
+ void SaveResponseStatus();
+ // Sets |response_status_| to |response_status| and sets
+ // |has_response_status_| to true.
+ void SetResponseStatus(int response_status);
+ // Computes the correct response status based on the status of the handshake,
+ // |session_error|, |connection_error| and |stream_error|.
+ int ComputeResponseStatus() const;
+
State next_state_;
base::WeakPtr<QuicChromiumClientSession> session_;
@@ -163,6 +175,7 @@ class NET_EXPORT_PRIVATE QuicHttpStream
// |response_info_| is the HTTP response data object which is filled in
// when a the response headers are read. It is not owned by this stream.
HttpResponseInfo* response_info_;
+ bool has_response_status_; // true if response_status_ as been set.
// Because response data is buffered, also buffer the response status if the
// stream is explicitly closed via OnError or OnClose with an error.
// Once all buffered data has been returned, this will be used as the final
@@ -202,7 +215,8 @@ class NET_EXPORT_PRIVATE QuicHttpStream
NetLogWithSource stream_net_log_;
- QuicErrorCode quic_connection_error_;
+ QuicErrorCode quic_connection_error_; // Cached connection error code.
+ QuicRstStreamErrorCode quic_stream_error_; // Cached stream error code.
// True when this stream receives a go away from server due to port migration.
bool port_migration_detected_;
« no previous file with comments | « no previous file | net/quic/chromium/quic_http_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698