OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // The base class for streams which deliver data to/from an application. | 5 // The base class for streams which deliver data to/from an application. |
6 // In each direction, the data on such a stream first contains compressed | 6 // In each direction, the data on such a stream first contains compressed |
7 // headers then body data. | 7 // headers then body data. |
8 | 8 |
9 #ifndef NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ | 9 #ifndef NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ |
10 #define NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ | 10 #define NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 // Override the base class to not discard response when receiving | 99 // Override the base class to not discard response when receiving |
100 // QUIC_STREAM_NO_ERROR. | 100 // QUIC_STREAM_NO_ERROR. |
101 void OnStreamReset(const QuicRstStreamFrame& frame) override; | 101 void OnStreamReset(const QuicRstStreamFrame& frame) override; |
102 | 102 |
103 // Writes the headers contained in |header_block| to the dedicated | 103 // Writes the headers contained in |header_block| to the dedicated |
104 // headers stream. | 104 // headers stream. |
105 virtual size_t WriteHeaders( | 105 virtual size_t WriteHeaders( |
106 SpdyHeaderBlock header_block, | 106 SpdyHeaderBlock header_block, |
107 bool fin, | 107 bool fin, |
108 scoped_refptr<QuicAckListenerInterface> ack_notifier_delegate); | 108 QuicReferenceCountedPointer<QuicAckListenerInterface> |
| 109 ack_notifier_delegate); |
109 | 110 |
110 // Sends |data| to the peer, or buffers if it can't be sent immediately. | 111 // Sends |data| to the peer, or buffers if it can't be sent immediately. |
111 void WriteOrBufferBody( | 112 void WriteOrBufferBody(const std::string& data, |
112 const std::string& data, | 113 bool fin, |
113 bool fin, | 114 QuicReferenceCountedPointer<QuicAckListenerInterface> |
114 scoped_refptr<QuicAckListenerInterface> ack_notifier_delegate); | 115 ack_notifier_delegate); |
115 | 116 |
116 // Writes the trailers contained in |trailer_block| to the dedicated | 117 // Writes the trailers contained in |trailer_block| to the dedicated |
117 // headers stream. Trailers will always have the FIN set. | 118 // headers stream. Trailers will always have the FIN set. |
118 virtual size_t WriteTrailers( | 119 virtual size_t WriteTrailers( |
119 SpdyHeaderBlock trailer_block, | 120 SpdyHeaderBlock trailer_block, |
120 scoped_refptr<QuicAckListenerInterface> ack_notifier_delegate); | 121 QuicReferenceCountedPointer<QuicAckListenerInterface> |
| 122 ack_notifier_delegate); |
121 | 123 |
122 // Marks the trailers as consumed. This applies to the case where this object | 124 // Marks the trailers as consumed. This applies to the case where this object |
123 // receives headers and trailers as QuicHeaderLists via calls to | 125 // receives headers and trailers as QuicHeaderLists via calls to |
124 // OnStreamHeaderList(). | 126 // OnStreamHeaderList(). |
125 void MarkTrailersConsumed(); | 127 void MarkTrailersConsumed(); |
126 | 128 |
127 // Clears |header_list_|. | 129 // Clears |header_list_|. |
128 void ConsumeHeaderList(); | 130 void ConsumeHeaderList(); |
129 | 131 |
130 // This block of functions wraps the sequencer's functions of the same | 132 // This block of functions wraps the sequencer's functions of the same |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 const QuicHeaderList& header_list); | 196 const QuicHeaderList& header_list); |
195 QuicSpdySession* spdy_session() const { return spdy_session_; } | 197 QuicSpdySession* spdy_session() const { return spdy_session_; } |
196 Visitor* visitor() { return visitor_; } | 198 Visitor* visitor() { return visitor_; } |
197 | 199 |
198 // Redirects to the headers stream if force HOL blocking enabled, | 200 // Redirects to the headers stream if force HOL blocking enabled, |
199 // otherwise just pass through. | 201 // otherwise just pass through. |
200 QuicConsumedData WritevDataInner( | 202 QuicConsumedData WritevDataInner( |
201 QuicIOVector iov, | 203 QuicIOVector iov, |
202 QuicStreamOffset offset, | 204 QuicStreamOffset offset, |
203 bool fin, | 205 bool fin, |
204 scoped_refptr<QuicAckListenerInterface> ack_notifier_delegate) override; | 206 QuicReferenceCountedPointer<QuicAckListenerInterface> |
| 207 ack_notifier_delegate) override; |
205 | 208 |
206 private: | 209 private: |
207 friend class test::QuicSpdyStreamPeer; | 210 friend class test::QuicSpdyStreamPeer; |
208 friend class test::QuicStreamPeer; | 211 friend class test::QuicStreamPeer; |
209 friend class QuicStreamUtils; | 212 friend class QuicStreamUtils; |
210 | 213 |
211 QuicSpdySession* spdy_session_; | 214 QuicSpdySession* spdy_session_; |
212 | 215 |
213 Visitor* visitor_; | 216 Visitor* visitor_; |
214 // If true, allow sending of a request to continue while the response is | 217 // If true, allow sending of a request to continue while the response is |
(...skipping 14 matching lines...) Expand all Loading... |
229 bool trailers_consumed_; | 232 bool trailers_consumed_; |
230 // The parsed trailers received from the peer. | 233 // The parsed trailers received from the peer. |
231 SpdyHeaderBlock received_trailers_; | 234 SpdyHeaderBlock received_trailers_; |
232 | 235 |
233 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); | 236 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); |
234 }; | 237 }; |
235 | 238 |
236 } // namespace net | 239 } // namespace net |
237 | 240 |
238 #endif // NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ | 241 #endif // NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ |
OLD | NEW |