| 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_QUIC_HTTP_STREAM_H_ | 5 #ifndef NET_QUIC_QUIC_HTTP_STREAM_H_ |
| 6 #define NET_QUIC_QUIC_HTTP_STREAM_H_ | 6 #define NET_QUIC_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_stream.h" | 21 #include "net/http/http_stream.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" |
| 26 #include "net/quic/core/quic_protocol.h" |
| 25 | 27 |
| 26 namespace net { | 28 namespace net { |
| 27 | 29 |
| 28 namespace test { | 30 namespace test { |
| 29 class QuicHttpStreamPeer; | 31 class QuicHttpStreamPeer; |
| 30 } // namespace test | 32 } // namespace test |
| 31 | 33 |
| 32 // The QuicHttpStream is a QUIC-specific HttpStream subclass. It holds a | 34 // The QuicHttpStream is a QUIC-specific HttpStream subclass. It holds a |
| 33 // non-owning pointer to a QuicChromiumClientStream which it uses to | 35 // non-owning pointer to a QuicChromiumClientStream which it uses to |
| 34 // send and receive data. | 36 // send and receive data. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // QuicChromiumClientSession::Observer implementation | 87 // QuicChromiumClientSession::Observer implementation |
| 86 void OnCryptoHandshakeConfirmed() override; | 88 void OnCryptoHandshakeConfirmed() override; |
| 87 void OnSessionClosed(int error, bool port_migration_detected) override; | 89 void OnSessionClosed(int error, bool port_migration_detected) override; |
| 88 | 90 |
| 89 // QuicClientPushPromiseIndex::Delegate implementation | 91 // QuicClientPushPromiseIndex::Delegate implementation |
| 90 bool CheckVary(const SpdyHeaderBlock& client_request, | 92 bool CheckVary(const SpdyHeaderBlock& client_request, |
| 91 const SpdyHeaderBlock& promise_request, | 93 const SpdyHeaderBlock& promise_request, |
| 92 const SpdyHeaderBlock& promise_response) override; | 94 const SpdyHeaderBlock& promise_response) override; |
| 93 void OnRendezvousResult(QuicSpdyStream* stream) override; | 95 void OnRendezvousResult(QuicSpdyStream* stream) override; |
| 94 | 96 |
| 97 static HttpResponseInfo::ConnectionInfo ConnectionInfoFromQuicVersion( |
| 98 QuicVersion quic_version); |
| 99 |
| 95 private: | 100 private: |
| 96 friend class test::QuicHttpStreamPeer; | 101 friend class test::QuicHttpStreamPeer; |
| 97 | 102 |
| 98 enum State { | 103 enum State { |
| 99 STATE_NONE, | 104 STATE_NONE, |
| 100 STATE_HANDLE_PROMISE, | 105 STATE_HANDLE_PROMISE, |
| 101 STATE_HANDLE_PROMISE_COMPLETE, | 106 STATE_HANDLE_PROMISE_COMPLETE, |
| 102 STATE_REQUEST_STREAM, | 107 STATE_REQUEST_STREAM, |
| 103 STATE_REQUEST_STREAM_COMPLETE, | 108 STATE_REQUEST_STREAM_COMPLETE, |
| 104 STATE_SET_REQUEST_PRIORITY, | 109 STATE_SET_REQUEST_PRIORITY, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 134 int ProcessResponseHeaders(const SpdyHeaderBlock& headers); | 139 int ProcessResponseHeaders(const SpdyHeaderBlock& headers); |
| 135 | 140 |
| 136 int ReadAvailableData(IOBuffer* buf, int buf_len); | 141 int ReadAvailableData(IOBuffer* buf, int buf_len); |
| 137 void EnterStateSendHeaders(); | 142 void EnterStateSendHeaders(); |
| 138 | 143 |
| 139 void ResetStream(); | 144 void ResetStream(); |
| 140 | 145 |
| 141 State next_state_; | 146 State next_state_; |
| 142 | 147 |
| 143 base::WeakPtr<QuicChromiumClientSession> session_; | 148 base::WeakPtr<QuicChromiumClientSession> session_; |
| 149 const QuicVersion quic_version_; |
| 144 int session_error_; // Error code from the connection shutdown. | 150 int session_error_; // Error code from the connection shutdown. |
| 145 bool was_handshake_confirmed_; // True if the crypto handshake succeeded. | 151 bool was_handshake_confirmed_; // True if the crypto handshake succeeded. |
| 146 QuicChromiumClientSession::StreamRequest stream_request_; | 152 QuicChromiumClientSession::StreamRequest stream_request_; |
| 147 QuicChromiumClientStream* stream_; // Non-owning. | 153 QuicChromiumClientStream* stream_; // Non-owning. |
| 148 | 154 |
| 149 // The following three fields are all owned by the caller and must | 155 // The following three fields are all owned by the caller and must |
| 150 // outlive this object, according to the HttpStream contract. | 156 // outlive this object, according to the HttpStream contract. |
| 151 | 157 |
| 152 // The request to send. | 158 // The request to send. |
| 153 // Only valid before the response body is read. | 159 // Only valid before the response body is read. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 LoadTimingInfo::ConnectTiming connect_timing_; | 232 LoadTimingInfo::ConnectTiming connect_timing_; |
| 227 | 233 |
| 228 base::WeakPtrFactory<QuicHttpStream> weak_factory_; | 234 base::WeakPtrFactory<QuicHttpStream> weak_factory_; |
| 229 | 235 |
| 230 DISALLOW_COPY_AND_ASSIGN(QuicHttpStream); | 236 DISALLOW_COPY_AND_ASSIGN(QuicHttpStream); |
| 231 }; | 237 }; |
| 232 | 238 |
| 233 } // namespace net | 239 } // namespace net |
| 234 | 240 |
| 235 #endif // NET_QUIC_QUIC_HTTP_STREAM_H_ | 241 #endif // NET_QUIC_QUIC_HTTP_STREAM_H_ |
| OLD | NEW |