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

Side by Side Diff: net/quic/chromium/quic_http_stream.h

Issue 2789093003: Mark QUIC broken when the network blackholes after the handshake (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_QUIC_CHROMIUM_QUIC_HTTP_STREAM_H_ 5 #ifndef NET_QUIC_CHROMIUM_QUIC_HTTP_STREAM_H_
6 #define NET_QUIC_CHROMIUM_QUIC_HTTP_STREAM_H_ 6 #define NET_QUIC_CHROMIUM_QUIC_HTTP_STREAM_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 24 matching lines...) Expand all
35 // The QuicHttpStream is a QUIC-specific HttpStream subclass. It holds a 35 // The QuicHttpStream is a QUIC-specific HttpStream subclass. It holds a
36 // non-owning pointer to a QuicChromiumClientStream which it uses to 36 // non-owning pointer to a QuicChromiumClientStream which it uses to
37 // send and receive data. 37 // send and receive data.
38 class NET_EXPORT_PRIVATE QuicHttpStream 38 class NET_EXPORT_PRIVATE QuicHttpStream
39 : public QuicChromiumClientSession::Observer, 39 : public QuicChromiumClientSession::Observer,
40 public QuicChromiumClientStream::Delegate, 40 public QuicChromiumClientStream::Delegate,
41 public QuicClientPushPromiseIndex::Delegate, 41 public QuicClientPushPromiseIndex::Delegate,
42 public MultiplexedHttpStream { 42 public MultiplexedHttpStream {
43 public: 43 public:
44 QuicHttpStream(const base::WeakPtr<QuicChromiumClientSession>& session, 44 QuicHttpStream(const base::WeakPtr<QuicChromiumClientSession>& session,
45 HttpServerProperties* http_server_properties); 45 HttpServerProperties* http_server_properties,
46 bool mark_quic_broken_when_network_suspected);
46 47
47 ~QuicHttpStream() override; 48 ~QuicHttpStream() override;
48 49
49 // HttpStream implementation. 50 // HttpStream implementation.
50 int InitializeStream(const HttpRequestInfo* request_info, 51 int InitializeStream(const HttpRequestInfo* request_info,
51 RequestPriority priority, 52 RequestPriority priority,
52 const NetLogWithSource& net_log, 53 const NetLogWithSource& net_log,
53 const CompletionCallback& callback) override; 54 const CompletionCallback& callback) override;
54 int SendRequest(const HttpRequestHeaders& request_headers, 55 int SendRequest(const HttpRequestHeaders& request_headers,
55 HttpResponseInfo* response, 56 HttpResponseInfo* response,
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // Sets |response_status_| to |response_status| and sets 144 // Sets |response_status_| to |response_status| and sets
144 // |has_response_status_| to true. 145 // |has_response_status_| to true.
145 void SetResponseStatus(int response_status); 146 void SetResponseStatus(int response_status);
146 // Computes the correct response status based on the status of the handshake, 147 // Computes the correct response status based on the status of the handshake,
147 // |session_error|, |connection_error| and |stream_error|. 148 // |session_error|, |connection_error| and |stream_error|.
148 int ComputeResponseStatus() const; 149 int ComputeResponseStatus() const;
149 150
150 State next_state_; 151 State next_state_;
151 152
152 base::WeakPtr<QuicChromiumClientSession> session_; 153 base::WeakPtr<QuicChromiumClientSession> session_;
154 QuicServerId server_id_; // The ID of the QUIC server for this stream.
Bence 2017/04/03 19:02:59 This member should be const.
Ryan Hamilton 2017/04/05 19:26:20 Done.
153 155
154 HttpServerProperties* http_server_properties_; 156 HttpServerProperties* http_server_properties_; // Unowned.
157 // True if QUIC should be marked as broken when a stream is closed with
158 // a possibly network-caused error.
159 bool mark_quic_broken_when_network_suspected_;
155 160
156 QuicVersion quic_version_; 161 QuicVersion quic_version_;
157 int session_error_; // Error code from the connection shutdown. 162 int session_error_; // Error code from the connection shutdown.
158 bool was_handshake_confirmed_; // True if the crypto handshake succeeded. 163 bool was_handshake_confirmed_; // True if the crypto handshake succeeded.
159 QuicChromiumClientSession::StreamRequest stream_request_; 164 QuicChromiumClientSession::StreamRequest stream_request_;
160 QuicChromiumClientStream* stream_; // Non-owning. 165 QuicChromiumClientStream* stream_; // Non-owning.
161 166
162 // The following three fields are all owned by the caller and must 167 // The following three fields are all owned by the caller and must
163 // outlive this object, according to the HttpStream contract. 168 // outlive this object, according to the HttpStream contract.
164 169
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 LoadTimingInfo::ConnectTiming connect_timing_; 240 LoadTimingInfo::ConnectTiming connect_timing_;
236 241
237 base::WeakPtrFactory<QuicHttpStream> weak_factory_; 242 base::WeakPtrFactory<QuicHttpStream> weak_factory_;
238 243
239 DISALLOW_COPY_AND_ASSIGN(QuicHttpStream); 244 DISALLOW_COPY_AND_ASSIGN(QuicHttpStream);
240 }; 245 };
241 246
242 } // namespace net 247 } // namespace net
243 248
244 #endif // NET_QUIC_CHROMIUM_QUIC_HTTP_STREAM_H_ 249 #endif // NET_QUIC_CHROMIUM_QUIC_HTTP_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698