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; |
24 class SpdySession; | 25 class SpdySession; |
25 class SSLCertRequestInfo; | 26 class SSLCertRequestInfo; |
26 class SSLInfo; | 27 class SSLInfo; |
27 | 28 |
28 // The SpdyStream is used by the SpdySession to represent each stream known | 29 // The SpdyStream is used by the SpdySession to represent each stream known |
29 // on the SpdySession. This class provides interfaces for SpdySession to use. | 30 // on the SpdySession. This class provides interfaces for SpdySession to use. |
30 // Streams can be created either by the client or by the server. When they | 31 // Streams can be created either by the client or by the server. When they |
31 // are initiated by the client, both the SpdySession and client object (such as | 32 // are initiated by the client, both the SpdySession and client object (such as |
32 // a SpdyNetworkTransaction) will maintain a reference to the stream. When | 33 // a SpdyNetworkTransaction) will maintain a reference to the stream. When |
33 // initiated by the server, only the SpdySession will maintain any reference, | 34 // initiated by the server, only the SpdySession will maintain any reference, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 123 } |
123 | 124 |
124 // Increases |send_window_size_| with delta extracted from a WINDOW_UPDATE | 125 // Increases |send_window_size_| with delta extracted from a WINDOW_UPDATE |
125 // frame; sends a RST_STREAM if delta overflows |send_window_size_| and | 126 // frame; sends a RST_STREAM if delta overflows |send_window_size_| and |
126 // removes the stream from the session. | 127 // removes the stream from the session. |
127 void IncreaseSendWindowSize(int delta_window_size); | 128 void IncreaseSendWindowSize(int delta_window_size); |
128 | 129 |
129 // Decreases |send_window_size_| by the given number of bytes. | 130 // Decreases |send_window_size_| by the given number of bytes. |
130 void DecreaseSendWindowSize(int delta_window_size); | 131 void DecreaseSendWindowSize(int delta_window_size); |
131 | 132 |
| 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 |
132 // Increases |recv_window_size_| by the given number of bytes, also sends | 139 // Increases |recv_window_size_| by the given number of bytes, also sends |
133 // a WINDOW_UPDATE frame. | 140 // a WINDOW_UPDATE frame. |
134 void IncreaseRecvWindowSize(int delta_window_size); | 141 void IncreaseRecvWindowSize(int delta_window_size); |
135 | 142 |
136 // Decreases |recv_window_size_| by the given number of bytes, called | 143 // Decreases |recv_window_size_| by the given number of bytes, called |
137 // whenever data is read. May also send a RST_STREAM and remove the | 144 // whenever data is read. May also send a RST_STREAM and remove the |
138 // stream from the session if the resultant |recv_window_size_| is | 145 // stream from the session if the resultant |recv_window_size_| is |
139 // negative, since that would be a flow control violation. | 146 // negative, since that would be a flow control violation. |
140 void DecreaseRecvWindowSize(int delta_window_size); | 147 void DecreaseRecvWindowSize(int delta_window_size); |
141 | 148 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 int recv_bytes_; | 292 int recv_bytes_; |
286 // Data received before delegate is attached. | 293 // Data received before delegate is attached. |
287 std::vector<scoped_refptr<IOBufferWithSize> > pending_buffers_; | 294 std::vector<scoped_refptr<IOBufferWithSize> > pending_buffers_; |
288 | 295 |
289 DISALLOW_COPY_AND_ASSIGN(SpdyStream); | 296 DISALLOW_COPY_AND_ASSIGN(SpdyStream); |
290 }; | 297 }; |
291 | 298 |
292 } // namespace net | 299 } // namespace net |
293 | 300 |
294 #endif // NET_SPDY_SPDY_STREAM_H_ | 301 #endif // NET_SPDY_SPDY_STREAM_H_ |
OLD | NEW |