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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 // If stream flow control is turned on, called by the session to | 172 // If stream flow control is turned on, called by the session to |
173 // decrease this stream's send window size by |delta_window_size|, | 173 // decrease this stream's send window size by |delta_window_size|, |
174 // which must be at least 0 and at most kMaxSpdyFrameChunkSize. | 174 // which must be at least 0 and at most kMaxSpdyFrameChunkSize. |
175 // |delta_window_size| must not cause this stream's send window size | 175 // |delta_window_size| must not cause this stream's send window size |
176 // to go negative. Does nothing if the stream is already closed. | 176 // to go negative. Does nothing if the stream is already closed. |
177 // | 177 // |
178 // If stream flow control is turned off, this must not be called. | 178 // If stream flow control is turned off, this must not be called. |
179 void DecreaseSendWindowSize(int32 delta_window_size); | 179 void DecreaseSendWindowSize(int32 delta_window_size); |
180 | 180 |
181 // Called by the delegate to increase this stream's receive window | |
182 // size by |delta_window_size|, which must be at least 1 and must | |
183 // not cause this stream's receive window size to overflow, possibly | |
184 // also sending a WINDOW_UPDATE frame. | |
185 // | |
186 // Unlike the functions above, this may be called even when stream | |
187 // flow control is turned off, although this does nothing in that | |
188 // case (and also if the stream is inactive). | |
189 void IncreaseRecvWindowSize(int32 delta_window_size); | |
190 | |
191 int GetPeerAddress(IPEndPoint* address) const; | 181 int GetPeerAddress(IPEndPoint* address) const; |
192 int GetLocalAddress(IPEndPoint* address) const; | 182 int GetLocalAddress(IPEndPoint* address) const; |
193 | 183 |
194 // Returns true if the underlying transport socket ever had any reads or | 184 // Returns true if the underlying transport socket ever had any reads or |
195 // writes. | 185 // writes. |
196 bool WasEverUsed() const; | 186 bool WasEverUsed() const; |
197 | 187 |
198 const BoundNetLog& net_log() const { return net_log_; } | 188 const BoundNetLog& net_log() const { return net_log_; } |
199 | 189 |
200 const SpdyHeaderBlock& spdy_headers() const; | 190 const SpdyHeaderBlock& spdy_headers() const; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 331 |
342 // Produces the SYN_STREAM frame for the stream. The stream must | 332 // Produces the SYN_STREAM frame for the stream. The stream must |
343 // already be activated. | 333 // already be activated. |
344 scoped_ptr<SpdyFrame> ProduceSynStreamFrame(); | 334 scoped_ptr<SpdyFrame> ProduceSynStreamFrame(); |
345 | 335 |
346 // Produce the initial HEADER frame for the stream with the given | 336 // Produce the initial HEADER frame for the stream with the given |
347 // block. The stream must already be activated. | 337 // block. The stream must already be activated. |
348 scoped_ptr<SpdyFrame> ProduceHeaderFrame( | 338 scoped_ptr<SpdyFrame> ProduceHeaderFrame( |
349 scoped_ptr<SpdyHeaderBlock> header_block); | 339 scoped_ptr<SpdyHeaderBlock> header_block); |
350 | 340 |
| 341 // Called by SpdyBuffers (via ConsumeCallbacks) to increase this |
| 342 // stream's receive window size by |delta_window_size|, which must |
| 343 // be at least 1 and must not cause this stream's receive window |
| 344 // size to overflow, possibly also sending a WINDOW_UPDATE frame. |
| 345 // |
| 346 // Unlike the functions above, this may be called even when stream |
| 347 // flow control is turned off, although this does nothing in that |
| 348 // case (and also if the stream is inactive). |
| 349 void IncreaseRecvWindowSize(size_t delta_window_size); |
| 350 |
351 // If the stream is active and stream flow control is turned on, | 351 // If the stream is active and stream flow control is turned on, |
352 // called by OnDataReceived (which is in turn called by the session) | 352 // called by OnDataReceived (which is in turn called by the session) |
353 // to decrease this stream's receive window size by | 353 // to decrease this stream's receive window size by |
354 // |delta_window_size|, which must be at least 1 and must not cause | 354 // |delta_window_size|, which must be at least 1 and must not cause |
355 // this stream's receive window size to go negative. | 355 // this stream's receive window size to go negative. |
356 void DecreaseRecvWindowSize(int32 delta_window_size); | 356 void DecreaseRecvWindowSize(int32 delta_window_size); |
357 | 357 |
358 base::WeakPtrFactory<SpdyStream> weak_ptr_factory_; | 358 base::WeakPtrFactory<SpdyStream> weak_ptr_factory_; |
359 | 359 |
360 // There is a small period of time between when a server pushed stream is | 360 // There is a small period of time between when a server pushed stream is |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 // When OnFrameWriteComplete() is called, these variables are set. | 423 // When OnFrameWriteComplete() is called, these variables are set. |
424 SpdyFrameType just_completed_frame_type_; | 424 SpdyFrameType just_completed_frame_type_; |
425 size_t just_completed_frame_size_; | 425 size_t just_completed_frame_size_; |
426 | 426 |
427 DISALLOW_COPY_AND_ASSIGN(SpdyStream); | 427 DISALLOW_COPY_AND_ASSIGN(SpdyStream); |
428 }; | 428 }; |
429 | 429 |
430 } // namespace net | 430 } // namespace net |
431 | 431 |
432 #endif // NET_SPDY_SPDY_STREAM_H_ | 432 #endif // NET_SPDY_SPDY_STREAM_H_ |
OLD | NEW |