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

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: 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') | net/quic/chromium/quic_http_stream.cc » ('J')
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 3dd498219175ef85728ba0bc01624ef4f5c3941d..d813b6cb840ff3db891ba40dd1a0f92bb1c985a7 100644
--- a/net/quic/chromium/quic_http_stream.h
+++ b/net/quic/chromium/quic_http_stream.h
@@ -134,6 +134,16 @@ 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();
Buck 2017/03/28 21:19:57 There seem to be instances where the return value
Ryan Hamilton 2017/03/28 21:54:03 Good idea. I thought about that but couldn't decid
+ // 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_;
@@ -159,6 +169,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
@@ -198,7 +209,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') | net/quic/chromium/quic_http_stream.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698