| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/linked_ptr.h" | 13 #include "base/linked_ptr.h" |
| 14 #include "base/ref_counted.h" | 14 #include "base/ref_counted.h" |
| 15 #include "base/scoped_ptr.h" | 15 #include "base/scoped_ptr.h" |
| 16 #include "net/base/bandwidth_metrics.h" | 16 #include "net/base/bandwidth_metrics.h" |
| 17 #include "net/base/io_buffer.h" | 17 #include "net/base/io_buffer.h" |
| 18 #include "net/base/net_log.h" | 18 #include "net/base/net_log.h" |
| 19 #include "net/spdy/spdy_framer.h" | 19 #include "net/spdy/spdy_framer.h" |
| 20 #include "net/spdy/spdy_protocol.h" | 20 #include "net/spdy/spdy_protocol.h" |
| 21 | 21 |
| 22 namespace net { | 22 namespace net { |
| 23 | 23 |
| 24 class AddressList; | |
| 25 class SpdySession; | 24 class SpdySession; |
| 26 class SSLCertRequestInfo; | 25 class SSLCertRequestInfo; |
| 27 class SSLInfo; | 26 class SSLInfo; |
| 28 | 27 |
| 29 // The SpdyStream is used by the SpdySession to represent each stream known | 28 // The SpdyStream is used by the SpdySession to represent each stream known |
| 30 // on the SpdySession. This class provides interfaces for SpdySession to use. | 29 // on the SpdySession. This class provides interfaces for SpdySession to use. |
| 31 // Streams can be created either by the client or by the server. When they | 30 // Streams can be created either by the client or by the server. When they |
| 32 // are initiated by the client, both the SpdySession and client object (such as | 31 // are initiated by the client, both the SpdySession and client object (such as |
| 33 // a SpdyNetworkTransaction) will maintain a reference to the stream. When | 32 // a SpdyNetworkTransaction) will maintain a reference to the stream. When |
| 34 // initiated by the server, only the SpdySession will maintain any reference, | 33 // initiated by the server, only the SpdySession will maintain any reference, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } | 122 } |
| 124 | 123 |
| 125 // Increases |send_window_size_| with delta extracted from a WINDOW_UPDATE | 124 // Increases |send_window_size_| with delta extracted from a WINDOW_UPDATE |
| 126 // frame; sends a RST_STREAM if delta overflows |send_window_size_| and | 125 // frame; sends a RST_STREAM if delta overflows |send_window_size_| and |
| 127 // removes the stream from the session. | 126 // removes the stream from the session. |
| 128 void IncreaseSendWindowSize(int delta_window_size); | 127 void IncreaseSendWindowSize(int delta_window_size); |
| 129 | 128 |
| 130 // Decreases |send_window_size_| by the given number of bytes. | 129 // Decreases |send_window_size_| by the given number of bytes. |
| 131 void DecreaseSendWindowSize(int delta_window_size); | 130 void DecreaseSendWindowSize(int delta_window_size); |
| 132 | 131 |
| 133 int GetPeerAddress(AddressList* address) const; | |
| 134 | |
| 135 // Returns true if the underlying transport socket ever had any reads or | |
| 136 // writes. | |
| 137 bool WasEverUsed() const; | |
| 138 | |
| 139 // Increases |recv_window_size_| by the given number of bytes, also sends | 132 // Increases |recv_window_size_| by the given number of bytes, also sends |
| 140 // a WINDOW_UPDATE frame. | 133 // a WINDOW_UPDATE frame. |
| 141 void IncreaseRecvWindowSize(int delta_window_size); | 134 void IncreaseRecvWindowSize(int delta_window_size); |
| 142 | 135 |
| 143 // Decreases |recv_window_size_| by the given number of bytes, called | 136 // Decreases |recv_window_size_| by the given number of bytes, called |
| 144 // whenever data is read. May also send a RST_STREAM and remove the | 137 // whenever data is read. May also send a RST_STREAM and remove the |
| 145 // stream from the session if the resultant |recv_window_size_| is | 138 // stream from the session if the resultant |recv_window_size_| is |
| 146 // negative, since that would be a flow control violation. | 139 // negative, since that would be a flow control violation. |
| 147 void DecreaseRecvWindowSize(int delta_window_size); | 140 void DecreaseRecvWindowSize(int delta_window_size); |
| 148 | 141 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 int recv_bytes_; | 285 int recv_bytes_; |
| 293 // Data received before delegate is attached. | 286 // Data received before delegate is attached. |
| 294 std::vector<scoped_refptr<IOBufferWithSize> > pending_buffers_; | 287 std::vector<scoped_refptr<IOBufferWithSize> > pending_buffers_; |
| 295 | 288 |
| 296 DISALLOW_COPY_AND_ASSIGN(SpdyStream); | 289 DISALLOW_COPY_AND_ASSIGN(SpdyStream); |
| 297 }; | 290 }; |
| 298 | 291 |
| 299 } // namespace net | 292 } // namespace net |
| 300 | 293 |
| 301 #endif // NET_SPDY_SPDY_STREAM_H_ | 294 #endif // NET_SPDY_SPDY_STREAM_H_ |
| OLD | NEW |