| 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 server specific QuicSession subclass. | 5 // A server specific QuicSession subclass. |
| 6 | 6 |
| 7 #ifndef NET_QUIC_QUIC_SERVER_SESSION_BASE_H_ | 7 #ifndef NET_QUIC_QUIC_SERVER_SESSION_BASE_H_ |
| 8 #define NET_QUIC_QUIC_SERVER_SESSION_BASE_H_ | 8 #define NET_QUIC_QUIC_SERVER_SESSION_BASE_H_ |
| 9 | 9 |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 virtual void OnConnectionClosed(QuicConnectionId connection_id, | 47 virtual void OnConnectionClosed(QuicConnectionId connection_id, |
| 48 QuicErrorCode error, | 48 QuicErrorCode error, |
| 49 const std::string& error_details) = 0; | 49 const std::string& error_details) = 0; |
| 50 | 50 |
| 51 // Called when the session has become write blocked. | 51 // Called when the session has become write blocked. |
| 52 virtual void OnWriteBlocked(QuicBlockedWriterInterface* blocked_writer) = 0; | 52 virtual void OnWriteBlocked(QuicBlockedWriterInterface* blocked_writer) = 0; |
| 53 | 53 |
| 54 // Called after the given connection is added to the time-wait std::list. | 54 // Called after the given connection is added to the time-wait std::list. |
| 55 virtual void OnConnectionAddedToTimeWaitList( | 55 virtual void OnConnectionAddedToTimeWaitList( |
| 56 QuicConnectionId connection_id) = 0; | 56 QuicConnectionId connection_id) = 0; |
| 57 |
| 58 // Called before a packet is going to be processed by |session|. |
| 59 virtual void OnPacketBeingDispatchedToSession( |
| 60 QuicServerSessionBase* session) = 0; |
| 57 }; | 61 }; |
| 58 | 62 |
| 59 // Provides helper functions for the session. | 63 // Provides helper functions for the session. |
| 60 class Helper { | 64 class Helper { |
| 61 public: | 65 public: |
| 62 virtual ~Helper() {} | 66 virtual ~Helper() {} |
| 63 | 67 |
| 64 // Given the current connection_id, generates a new ConnectionId to | 68 // Given the current connection_id, generates a new ConnectionId to |
| 65 // be returned with a stateless reject. | 69 // be returned with a stateless reject. |
| 66 virtual QuicConnectionId GenerateConnectionIdForReject( | 70 virtual QuicConnectionId GenerateConnectionIdForReject( |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 bool ShouldCreateIncomingDynamicStream(QuicStreamId id) override; | 139 bool ShouldCreateIncomingDynamicStream(QuicStreamId id) override; |
| 136 | 140 |
| 137 virtual QuicCryptoServerStreamBase* CreateQuicCryptoServerStream( | 141 virtual QuicCryptoServerStreamBase* CreateQuicCryptoServerStream( |
| 138 const QuicCryptoServerConfig* crypto_config, | 142 const QuicCryptoServerConfig* crypto_config, |
| 139 QuicCompressedCertsCache* compressed_certs_cache) = 0; | 143 QuicCompressedCertsCache* compressed_certs_cache) = 0; |
| 140 | 144 |
| 141 const QuicCryptoServerConfig* crypto_config() { return crypto_config_; } | 145 const QuicCryptoServerConfig* crypto_config() { return crypto_config_; } |
| 142 | 146 |
| 143 void set_server_push_enabled(bool enable) { server_push_enabled_ = enable; } | 147 void set_server_push_enabled(bool enable) { server_push_enabled_ = enable; } |
| 144 | 148 |
| 149 Visitor* visitor() { return visitor_; } |
| 150 |
| 145 private: | 151 private: |
| 146 friend class test::QuicServerSessionBasePeer; | 152 friend class test::QuicServerSessionBasePeer; |
| 147 friend class test::QuicSimpleServerSessionPeer; | 153 friend class test::QuicSimpleServerSessionPeer; |
| 148 | 154 |
| 149 const QuicCryptoServerConfig* crypto_config_; | 155 const QuicCryptoServerConfig* crypto_config_; |
| 150 | 156 |
| 151 // The cache which contains most recently compressed certs. | 157 // The cache which contains most recently compressed certs. |
| 152 // Owned by QuicDispatcher. | 158 // Owned by QuicDispatcher. |
| 153 QuicCompressedCertsCache* compressed_certs_cache_; | 159 QuicCompressedCertsCache* compressed_certs_cache_; |
| 154 | 160 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 181 // Set during handshake. If true, resources in x-associated-content and link | 187 // Set during handshake. If true, resources in x-associated-content and link |
| 182 // headers will be pushed. see: go/gfe_server_push. | 188 // headers will be pushed. see: go/gfe_server_push. |
| 183 bool server_push_enabled_; | 189 bool server_push_enabled_; |
| 184 | 190 |
| 185 DISALLOW_COPY_AND_ASSIGN(QuicServerSessionBase); | 191 DISALLOW_COPY_AND_ASSIGN(QuicServerSessionBase); |
| 186 }; | 192 }; |
| 187 | 193 |
| 188 } // namespace net | 194 } // namespace net |
| 189 | 195 |
| 190 #endif // NET_QUIC_QUIC_SERVER_SESSION_BASE_H_ | 196 #endif // NET_QUIC_QUIC_SERVER_SESSION_BASE_H_ |
| OLD | NEW |