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_SPDY_SPDY_STREAM_H_ | 5 #ifndef NET_SPDY_SPDY_STREAM_H_ |
6 #define NET_SPDY_SPDY_STREAM_H_ | 6 #define NET_SPDY_SPDY_STREAM_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 255 |
256 // Called by OnReadBufferConsume to increase this stream's receive | 256 // Called by OnReadBufferConsume to increase this stream's receive |
257 // window size by |delta_window_size|, which must be at least 1 and | 257 // window size by |delta_window_size|, which must be at least 1 and |
258 // must not cause this stream's receive window size to overflow, | 258 // must not cause this stream's receive window size to overflow, |
259 // possibly also sending a WINDOW_UPDATE frame. Does nothing if the | 259 // possibly also sending a WINDOW_UPDATE frame. Does nothing if the |
260 // stream is not active. | 260 // stream is not active. |
261 // | 261 // |
262 // If stream flow control is turned off, this must not be called. | 262 // If stream flow control is turned off, this must not be called. |
263 void IncreaseRecvWindowSize(int32 delta_window_size); | 263 void IncreaseRecvWindowSize(int32 delta_window_size); |
264 | 264 |
265 // Called by OnDataReceived (which is in turn called by the session) | 265 // Called by OnDataReceived or OnPaddingConsumed (which are in turn called by |
266 // to decrease this stream's receive window size by | 266 // the session) to decrease this stream's receive window size by |
267 // |delta_window_size|, which must be at least 1 and must not cause | 267 // |delta_window_size|, which must be at least 1 and must not cause |
268 // this stream's receive window size to go negative. | 268 // this stream's receive window size to go negative. |
269 // | 269 // |
270 // If stream flow control is turned off or the stream is not active, | 270 // If stream flow control is turned off or the stream is not active, |
271 // this must not be called. | 271 // this must not be called. |
272 void DecreaseRecvWindowSize(int32 delta_window_size); | 272 void DecreaseRecvWindowSize(int32 delta_window_size); |
273 | 273 |
274 int GetPeerAddress(IPEndPoint* address) const; | 274 int GetPeerAddress(IPEndPoint* address) const; |
275 int GetLocalAddress(IPEndPoint* address) const; | 275 int GetLocalAddress(IPEndPoint* address) const; |
276 | 276 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 // OnResponseHeadersReceived. | 308 // OnResponseHeadersReceived. |
309 // | 309 // |
310 // |buffer| contains the data received, or NULL if the stream is | 310 // |buffer| contains the data received, or NULL if the stream is |
311 // being closed. The stream must copy any data from this | 311 // being closed. The stream must copy any data from this |
312 // buffer before returning from this callback. | 312 // buffer before returning from this callback. |
313 // | 313 // |
314 // |length| is the number of bytes received (at most 2^24 - 1) or 0 if | 314 // |length| is the number of bytes received (at most 2^24 - 1) or 0 if |
315 // the stream is being closed. | 315 // the stream is being closed. |
316 void OnDataReceived(scoped_ptr<SpdyBuffer> buffer); | 316 void OnDataReceived(scoped_ptr<SpdyBuffer> buffer); |
317 | 317 |
| 318 // Called by the SpdySession when padding is consumed to allow for the stream |
| 319 // receiving window to be updated. |
| 320 void OnPaddingConsumed(size_t len); |
| 321 |
318 // Called by the SpdySession when a frame has been successfully and | 322 // Called by the SpdySession when a frame has been successfully and |
319 // completely written. |frame_size| is the total size of the frame | 323 // completely written. |frame_size| is the total size of the frame |
320 // in bytes, including framing overhead. | 324 // in bytes, including framing overhead. |
321 void OnFrameWriteComplete(SpdyFrameType frame_type, size_t frame_size); | 325 void OnFrameWriteComplete(SpdyFrameType frame_type, size_t frame_size); |
322 | 326 |
323 // SYN_STREAM-specific write handler invoked by OnFrameWriteComplete(). | 327 // SYN_STREAM-specific write handler invoked by OnFrameWriteComplete(). |
324 int OnRequestHeadersSent(); | 328 int OnRequestHeadersSent(); |
325 | 329 |
326 // DATA-specific write handler invoked by OnFrameWriteComplete(). | 330 // DATA-specific write handler invoked by OnFrameWriteComplete(). |
327 // If more data is already available to be written, the next write is | 331 // If more data is already available to be written, the next write is |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 bool write_handler_guard_; | 567 bool write_handler_guard_; |
564 | 568 |
565 base::WeakPtrFactory<SpdyStream> weak_ptr_factory_; | 569 base::WeakPtrFactory<SpdyStream> weak_ptr_factory_; |
566 | 570 |
567 DISALLOW_COPY_AND_ASSIGN(SpdyStream); | 571 DISALLOW_COPY_AND_ASSIGN(SpdyStream); |
568 }; | 572 }; |
569 | 573 |
570 } // namespace net | 574 } // namespace net |
571 | 575 |
572 #endif // NET_SPDY_SPDY_STREAM_H_ | 576 #endif // NET_SPDY_SPDY_STREAM_H_ |
OLD | NEW |