| 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 side dispatcher which dispatches a given client's data to their | 5 // A server side dispatcher which dispatches a given client's data to their |
| 6 // stream. | 6 // stream. |
| 7 | 7 |
| 8 #ifndef NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ | 8 #ifndef NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ |
| 9 #define NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ | 9 #define NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ |
| 10 | 10 |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 void SetLastError(QuicErrorCode error); | 250 void SetLastError(QuicErrorCode error); |
| 251 | 251 |
| 252 // Called when the public header has been parsed and the session has been | 252 // Called when the public header has been parsed and the session has been |
| 253 // looked up, and the session was not found in the active list of sessions. | 253 // looked up, and the session was not found in the active list of sessions. |
| 254 // Returns false if processing should stop after this call. | 254 // Returns false if processing should stop after this call. |
| 255 virtual bool OnUnauthenticatedUnknownPublicHeader( | 255 virtual bool OnUnauthenticatedUnknownPublicHeader( |
| 256 const QuicPacketPublicHeader& header); | 256 const QuicPacketPublicHeader& header); |
| 257 | 257 |
| 258 // Called when a new connection starts to be handled by this dispatcher. | 258 // Called when a new connection starts to be handled by this dispatcher. |
| 259 // Either this connection is created or its packets is buffered while waiting | 259 // Either this connection is created or its packets is buffered while waiting |
| 260 // for CHLO. | 260 // for CHLO. Returns true if a new connection should be created or its packets |
| 261 virtual void OnNewConnectionAdded(QuicConnectionId connection_id); | 261 // should be buffered, false otherwise. |
| 262 virtual bool ShouldCreateOrBufferPacketForConnection( |
| 263 QuicConnectionId connection_id); |
| 262 | 264 |
| 263 bool HasBufferedPackets(QuicConnectionId connection_id); | 265 bool HasBufferedPackets(QuicConnectionId connection_id); |
| 264 | 266 |
| 265 // Called when BufferEarlyPacket() fail to buffer the packet. | 267 // Called when BufferEarlyPacket() fail to buffer the packet. |
| 266 virtual void OnBufferPacketFailure( | 268 virtual void OnBufferPacketFailure( |
| 267 QuicBufferedPacketStore::EnqueuePacketResult result, | 269 QuicBufferedPacketStore::EnqueuePacketResult result, |
| 268 QuicConnectionId connection_id); | 270 QuicConnectionId connection_id); |
| 269 | 271 |
| 270 private: | 272 private: |
| 271 friend class net::test::QuicDispatcherPeer; | 273 friend class net::test::QuicDispatcherPeer; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 // A backward counter of how many new sessions can be create within current | 364 // A backward counter of how many new sessions can be create within current |
| 363 // event loop. When reaches 0, it means can't create sessions for now. | 365 // event loop. When reaches 0, it means can't create sessions for now. |
| 364 int16_t new_sessions_allowed_per_event_loop_; | 366 int16_t new_sessions_allowed_per_event_loop_; |
| 365 | 367 |
| 366 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); | 368 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); |
| 367 }; | 369 }; |
| 368 | 370 |
| 369 } // namespace net | 371 } // namespace net |
| 370 | 372 |
| 371 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ | 373 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ |
| OLD | NEW |