| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // the server and thus the encryption key has been updated. Therefore the | 45 // the server and thus the encryption key has been updated. Therefore the |
| 46 // connection should resend any packets that were sent under | 46 // connection should resend any packets that were sent under |
| 47 // ENCRYPTION_INITIAL. (Client only.) | 47 // ENCRYPTION_INITIAL. (Client only.) |
| 48 ENCRYPTION_REESTABLISHED, | 48 ENCRYPTION_REESTABLISHED, |
| 49 // HANDSHAKE_CONFIRMED, in a client, indicates the the server has accepted | 49 // HANDSHAKE_CONFIRMED, in a client, indicates the the server has accepted |
| 50 // our handshake. In a server it indicates that a full, valid client hello | 50 // our handshake. In a server it indicates that a full, valid client hello |
| 51 // has been received. (Client and server.) | 51 // has been received. (Client and server.) |
| 52 HANDSHAKE_CONFIRMED, | 52 HANDSHAKE_CONFIRMED, |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 QuicSession(QuicConnection* connection, | 55 QuicSession(QuicConnection* connection, const QuicConfig& config); |
| 56 const QuicConfig& config, | |
| 57 bool is_secure); | |
| 58 void InitializeSession(); | 56 void InitializeSession(); |
| 59 | 57 |
| 60 ~QuicSession() override; | 58 ~QuicSession() override; |
| 61 | 59 |
| 62 // QuicConnectionVisitorInterface methods: | 60 // QuicConnectionVisitorInterface methods: |
| 63 void OnStreamFrames(const std::vector<QuicStreamFrame>& frames) override; | 61 void OnStreamFrames(const std::vector<QuicStreamFrame>& frames) override; |
| 64 void OnRstStream(const QuicRstStreamFrame& frame) override; | 62 void OnRstStream(const QuicRstStreamFrame& frame) override; |
| 65 void OnGoAway(const QuicGoAwayFrame& frame) override; | 63 void OnGoAway(const QuicGoAwayFrame& frame) override; |
| 66 void OnWindowUpdateFrames( | 64 void OnWindowUpdateFrames( |
| 67 const std::vector<QuicWindowUpdateFrame>& frames) override; | 65 const std::vector<QuicWindowUpdateFrame>& frames) override; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 203 |
| 206 QuicFlowController* flow_controller() { return flow_controller_.get(); } | 204 QuicFlowController* flow_controller() { return flow_controller_.get(); } |
| 207 | 205 |
| 208 // Returns true if connection is flow controller blocked. | 206 // Returns true if connection is flow controller blocked. |
| 209 bool IsConnectionFlowControlBlocked() const; | 207 bool IsConnectionFlowControlBlocked() const; |
| 210 | 208 |
| 211 // Returns true if any stream is flow controller blocked. | 209 // Returns true if any stream is flow controller blocked. |
| 212 bool IsStreamFlowControlBlocked(); | 210 bool IsStreamFlowControlBlocked(); |
| 213 | 211 |
| 214 // Returns true if this is a secure QUIC session. | 212 // Returns true if this is a secure QUIC session. |
| 215 bool is_secure() const { | 213 bool IsSecure() const { |
| 216 return is_secure_; | 214 return connection()->is_secure(); |
| 217 } | 215 } |
| 218 | 216 |
| 219 size_t get_max_open_streams() const { return max_open_streams_; } | 217 size_t get_max_open_streams() const { return max_open_streams_; } |
| 220 | 218 |
| 221 protected: | 219 protected: |
| 222 typedef base::hash_map<QuicStreamId, QuicDataStream*> DataStreamMap; | 220 typedef base::hash_map<QuicStreamId, QuicDataStream*> DataStreamMap; |
| 223 | 221 |
| 224 // Creates a new stream, owned by the caller, to handle a peer-initiated | 222 // Creates a new stream, owned by the caller, to handle a peer-initiated |
| 225 // stream. Returns nullptr and does error handling if the stream can not be | 223 // stream. Returns nullptr and does error handling if the stream can not be |
| 226 // created. | 224 // created. |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 333 |
| 336 // True if this is a secure (HTTPS) QUIC session. | 334 // True if this is a secure (HTTPS) QUIC session. |
| 337 bool is_secure_; | 335 bool is_secure_; |
| 338 | 336 |
| 339 DISALLOW_COPY_AND_ASSIGN(QuicSession); | 337 DISALLOW_COPY_AND_ASSIGN(QuicSession); |
| 340 }; | 338 }; |
| 341 | 339 |
| 342 } // namespace net | 340 } // namespace net |
| 343 | 341 |
| 344 #endif // NET_QUIC_QUIC_SESSION_H_ | 342 #endif // NET_QUIC_QUIC_SESSION_H_ |
| OLD | NEW |