| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 server specific QuicSession subclass. | 5 // A server specific QuicSession subclass. |
| 6 | 6 |
| 7 #ifndef NET_QUIC_QUIC_SERVER_SESSION_H_ | 7 #ifndef NET_QUIC_QUIC_SERVER_SESSION_H_ |
| 8 #define NET_QUIC_QUIC_SERVER_SESSION_H_ | 8 #define NET_QUIC_QUIC_SERVER_SESSION_H_ |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 public: | 37 public: |
| 38 virtual ~QuicServerSessionVisitor() {} | 38 virtual ~QuicServerSessionVisitor() {} |
| 39 | 39 |
| 40 virtual void OnConnectionClosed(QuicConnectionId connection_id, | 40 virtual void OnConnectionClosed(QuicConnectionId connection_id, |
| 41 QuicErrorCode error) = 0; | 41 QuicErrorCode error) = 0; |
| 42 virtual void OnWriteBlocked(QuicBlockedWriterInterface* blocked_writer) = 0; | 42 virtual void OnWriteBlocked(QuicBlockedWriterInterface* blocked_writer) = 0; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 class QuicServerSession : public QuicSession { | 45 class QuicServerSession : public QuicSession { |
| 46 public: | 46 public: |
| 47 // Takes ownership of connection_packet_writer | |
| 48 QuicServerSession(const QuicConfig& config, | 47 QuicServerSession(const QuicConfig& config, |
| 49 QuicConnection* connection, | 48 QuicConnection* connection, |
| 50 QuicPerConnectionPacketWriter* connection_packet_writer, | |
| 51 QuicServerSessionVisitor* visitor); | 49 QuicServerSessionVisitor* visitor); |
| 52 | 50 |
| 53 // Override the base class to notify the owner of the connection close. | 51 // Override the base class to notify the owner of the connection close. |
| 54 virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) OVERRIDE; | 52 virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) OVERRIDE; |
| 55 virtual void OnWriteBlocked() OVERRIDE; | 53 virtual void OnWriteBlocked() OVERRIDE; |
| 56 | 54 |
| 57 virtual ~QuicServerSession(); | 55 virtual ~QuicServerSession(); |
| 58 | 56 |
| 59 virtual void InitializeSession(const QuicCryptoServerConfig& crypto_config); | 57 virtual void InitializeSession(const QuicCryptoServerConfig& crypto_config); |
| 60 | 58 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 76 // possibly closing the connection, and returns false. | 74 // possibly closing the connection, and returns false. |
| 77 virtual bool ShouldCreateIncomingDataStream(QuicStreamId id); | 75 virtual bool ShouldCreateIncomingDataStream(QuicStreamId id); |
| 78 | 76 |
| 79 virtual QuicCryptoServerStream* CreateQuicCryptoServerStream( | 77 virtual QuicCryptoServerStream* CreateQuicCryptoServerStream( |
| 80 const QuicCryptoServerConfig& crypto_config); | 78 const QuicCryptoServerConfig& crypto_config); |
| 81 | 79 |
| 82 private: | 80 private: |
| 83 friend class test::QuicServerSessionPeer; | 81 friend class test::QuicServerSessionPeer; |
| 84 | 82 |
| 85 scoped_ptr<QuicCryptoServerStream> crypto_stream_; | 83 scoped_ptr<QuicCryptoServerStream> crypto_stream_; |
| 86 scoped_ptr<QuicPerConnectionPacketWriter> connection_packet_writer_; | |
| 87 QuicServerSessionVisitor* visitor_; | 84 QuicServerSessionVisitor* visitor_; |
| 88 | 85 |
| 89 DISALLOW_COPY_AND_ASSIGN(QuicServerSession); | 86 DISALLOW_COPY_AND_ASSIGN(QuicServerSession); |
| 90 }; | 87 }; |
| 91 | 88 |
| 92 } // namespace net | 89 } // namespace net |
| 93 | 90 |
| 94 #endif // NET_QUIC_QUIC_SERVER_SESSION_H_ | 91 #endif // NET_QUIC_QUIC_SERVER_SESSION_H_ |
| OLD | NEW |