| OLD | NEW |
| 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 |
| 11 #include <list> | 11 #include <list> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "net/base/io_buffer.h" | 17 #include "net/base/io_buffer.h" |
| 18 #include "net/base/load_timing_info.h" | 18 #include "net/base/load_timing_info.h" |
| 19 #include "net/base/net_export.h" | 19 #include "net/base/net_export.h" |
| 20 #include "net/http/http_response_info.h" | 20 #include "net/http/http_response_info.h" |
| 21 #include "net/http/http_server_properties.h" |
| 21 #include "net/log/net_log_with_source.h" | 22 #include "net/log/net_log_with_source.h" |
| 22 #include "net/quic/chromium/quic_chromium_client_session.h" | 23 #include "net/quic/chromium/quic_chromium_client_session.h" |
| 23 #include "net/quic/chromium/quic_chromium_client_stream.h" | 24 #include "net/quic/chromium/quic_chromium_client_stream.h" |
| 24 #include "net/quic/core/quic_client_push_promise_index.h" | 25 #include "net/quic/core/quic_client_push_promise_index.h" |
| 25 #include "net/quic/core/quic_packets.h" | 26 #include "net/quic/core/quic_packets.h" |
| 26 #include "net/spdy/multiplexed_http_stream.h" | 27 #include "net/spdy/multiplexed_http_stream.h" |
| 27 | 28 |
| 28 namespace net { | 29 namespace net { |
| 29 | 30 |
| 30 namespace test { | 31 namespace test { |
| 31 class QuicHttpStreamPeer; | 32 class QuicHttpStreamPeer; |
| 32 } // namespace test | 33 } // namespace test |
| 33 | 34 |
| 34 // The QuicHttpStream is a QUIC-specific HttpStream subclass. It holds a | 35 // The QuicHttpStream is a QUIC-specific HttpStream subclass. It holds a |
| 35 // non-owning pointer to a QuicChromiumClientStream which it uses to | 36 // non-owning pointer to a QuicChromiumClientStream which it uses to |
| 36 // send and receive data. | 37 // send and receive data. |
| 37 class NET_EXPORT_PRIVATE QuicHttpStream | 38 class NET_EXPORT_PRIVATE QuicHttpStream |
| 38 : public QuicChromiumClientSession::Observer, | 39 : public QuicChromiumClientSession::Observer, |
| 39 public QuicChromiumClientStream::Delegate, | 40 public QuicChromiumClientStream::Delegate, |
| 40 public QuicClientPushPromiseIndex::Delegate, | 41 public QuicClientPushPromiseIndex::Delegate, |
| 41 public MultiplexedHttpStream { | 42 public MultiplexedHttpStream { |
| 42 public: | 43 public: |
| 43 explicit QuicHttpStream( | 44 QuicHttpStream(const base::WeakPtr<QuicChromiumClientSession>& session, |
| 44 const base::WeakPtr<QuicChromiumClientSession>& session); | 45 HttpServerProperties* http_server_properties); |
| 45 | 46 |
| 46 ~QuicHttpStream() override; | 47 ~QuicHttpStream() override; |
| 47 | 48 |
| 48 // HttpStream implementation. | 49 // HttpStream implementation. |
| 49 int InitializeStream(const HttpRequestInfo* request_info, | 50 int InitializeStream(const HttpRequestInfo* request_info, |
| 50 RequestPriority priority, | 51 RequestPriority priority, |
| 51 const NetLogWithSource& net_log, | 52 const NetLogWithSource& net_log, |
| 52 const CompletionCallback& callback) override; | 53 const CompletionCallback& callback) override; |
| 53 int SendRequest(const HttpRequestHeaders& request_headers, | 54 int SendRequest(const HttpRequestHeaders& request_headers, |
| 54 HttpResponseInfo* response, | 55 HttpResponseInfo* response, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 int ProcessResponseHeaders(const SpdyHeaderBlock& headers); | 131 int ProcessResponseHeaders(const SpdyHeaderBlock& headers); |
| 131 | 132 |
| 132 int ReadAvailableData(IOBuffer* buf, int buf_len); | 133 int ReadAvailableData(IOBuffer* buf, int buf_len); |
| 133 void EnterStateSendHeaders(); | 134 void EnterStateSendHeaders(); |
| 134 | 135 |
| 135 void ResetStream(); | 136 void ResetStream(); |
| 136 | 137 |
| 137 State next_state_; | 138 State next_state_; |
| 138 | 139 |
| 139 base::WeakPtr<QuicChromiumClientSession> session_; | 140 base::WeakPtr<QuicChromiumClientSession> session_; |
| 141 |
| 142 HttpServerProperties* http_server_properties_; |
| 143 |
| 140 QuicVersion quic_version_; | 144 QuicVersion quic_version_; |
| 141 int session_error_; // Error code from the connection shutdown. | 145 int session_error_; // Error code from the connection shutdown. |
| 142 bool was_handshake_confirmed_; // True if the crypto handshake succeeded. | 146 bool was_handshake_confirmed_; // True if the crypto handshake succeeded. |
| 143 QuicChromiumClientSession::StreamRequest stream_request_; | 147 QuicChromiumClientSession::StreamRequest stream_request_; |
| 144 QuicChromiumClientStream* stream_; // Non-owning. | 148 QuicChromiumClientStream* stream_; // Non-owning. |
| 145 | 149 |
| 146 // The following three fields are all owned by the caller and must | 150 // The following three fields are all owned by the caller and must |
| 147 // outlive this object, according to the HttpStream contract. | 151 // outlive this object, according to the HttpStream contract. |
| 148 | 152 |
| 149 // The request to send. | 153 // The request to send. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 LoadTimingInfo::ConnectTiming connect_timing_; | 221 LoadTimingInfo::ConnectTiming connect_timing_; |
| 218 | 222 |
| 219 base::WeakPtrFactory<QuicHttpStream> weak_factory_; | 223 base::WeakPtrFactory<QuicHttpStream> weak_factory_; |
| 220 | 224 |
| 221 DISALLOW_COPY_AND_ASSIGN(QuicHttpStream); | 225 DISALLOW_COPY_AND_ASSIGN(QuicHttpStream); |
| 222 }; | 226 }; |
| 223 | 227 |
| 224 } // namespace net | 228 } // namespace net |
| 225 | 229 |
| 226 #endif // NET_QUIC_CHROMIUM_QUIC_HTTP_STREAM_H_ | 230 #endif // NET_QUIC_CHROMIUM_QUIC_HTTP_STREAM_H_ |
| OLD | NEW |