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 // A QuicSession, which demuxes a single connection to individual streams. | 5 // A QuicSession, which demuxes a single connection to individual streams. |
6 | 6 |
7 #ifndef NET_QUIC_QUIC_SESSION_H_ | 7 #ifndef NET_QUIC_QUIC_SESSION_H_ |
8 #define NET_QUIC_QUIC_SESSION_H_ | 8 #define NET_QUIC_QUIC_SESSION_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 const std::vector<QuicWindowUpdateFrame>& frames) OVERRIDE; | 66 const std::vector<QuicWindowUpdateFrame>& frames) OVERRIDE; |
67 virtual void OnBlockedFrames( | 67 virtual void OnBlockedFrames( |
68 const std::vector<QuicBlockedFrame>& frames) OVERRIDE; | 68 const std::vector<QuicBlockedFrame>& frames) OVERRIDE; |
69 virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) OVERRIDE; | 69 virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) OVERRIDE; |
70 virtual void OnWriteBlocked() OVERRIDE {} | 70 virtual void OnWriteBlocked() OVERRIDE {} |
71 virtual void OnSuccessfulVersionNegotiation( | 71 virtual void OnSuccessfulVersionNegotiation( |
72 const QuicVersion& version) OVERRIDE {} | 72 const QuicVersion& version) OVERRIDE {} |
73 virtual void OnCanWrite() OVERRIDE; | 73 virtual void OnCanWrite() OVERRIDE; |
74 virtual bool HasPendingWrites() const OVERRIDE; | 74 virtual bool HasPendingWrites() const OVERRIDE; |
75 virtual bool HasPendingHandshake() const OVERRIDE; | 75 virtual bool HasPendingHandshake() const OVERRIDE; |
| 76 virtual bool HasOpenDataStreams() const OVERRIDE; |
76 | 77 |
77 // Called by the headers stream when headers have been received for a stream. | 78 // Called by the headers stream when headers have been received for a stream. |
78 virtual void OnStreamHeaders(QuicStreamId stream_id, | 79 virtual void OnStreamHeaders(QuicStreamId stream_id, |
79 base::StringPiece headers_data); | 80 base::StringPiece headers_data); |
80 // Called by the headers stream when headers with a priority have been | 81 // Called by the headers stream when headers with a priority have been |
81 // received for this stream. This method will only be called for server | 82 // received for this stream. This method will only be called for server |
82 // streams. | 83 // streams. |
83 virtual void OnStreamHeadersPriority(QuicStreamId stream_id, | 84 virtual void OnStreamHeadersPriority(QuicStreamId stream_id, |
84 QuicPriority priority); | 85 QuicPriority priority); |
85 // Called by the headers stream when headers have been completely received | 86 // Called by the headers stream when headers have been completely received |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 const IPEndPoint& peer_address() const { | 169 const IPEndPoint& peer_address() const { |
169 return connection_->peer_address(); | 170 return connection_->peer_address(); |
170 } | 171 } |
171 QuicConnectionId connection_id() const { | 172 QuicConnectionId connection_id() const { |
172 return connection_->connection_id(); | 173 return connection_->connection_id(); |
173 } | 174 } |
174 | 175 |
175 QuicPacketCreator::Options* options() { return connection()->options(); } | 176 QuicPacketCreator::Options* options() { return connection()->options(); } |
176 | 177 |
177 // Returns the number of currently open streams, including those which have | 178 // Returns the number of currently open streams, including those which have |
178 // been implicitly created. | 179 // been implicitly created, but excluding the reserved headers and crypto |
| 180 // streams. |
179 virtual size_t GetNumOpenStreams() const; | 181 virtual size_t GetNumOpenStreams() const; |
180 | 182 |
181 void MarkWriteBlocked(QuicStreamId id, QuicPriority priority); | 183 void MarkWriteBlocked(QuicStreamId id, QuicPriority priority); |
182 | 184 |
183 // Returns true if the session has data to be sent, either queued in the | 185 // Returns true if the session has data to be sent, either queued in the |
184 // connection, or in a write-blocked stream. | 186 // connection, or in a write-blocked stream. |
185 bool HasDataToWrite() const; | 187 bool HasDataToWrite() const; |
186 | 188 |
187 bool goaway_received() const { | 189 bool goaway_received() const { |
188 return goaway_received_; | 190 return goaway_received_; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 294 |
293 // Indicate if there is pending data for the crypto stream. | 295 // Indicate if there is pending data for the crypto stream. |
294 bool has_pending_handshake_; | 296 bool has_pending_handshake_; |
295 | 297 |
296 DISALLOW_COPY_AND_ASSIGN(QuicSession); | 298 DISALLOW_COPY_AND_ASSIGN(QuicSession); |
297 }; | 299 }; |
298 | 300 |
299 } // namespace net | 301 } // namespace net |
300 | 302 |
301 #endif // NET_QUIC_QUIC_SESSION_H_ | 303 #endif // NET_QUIC_QUIC_SESSION_H_ |
OLD | NEW |