| 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 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_QUIC_QUIC_DISPATCHER_H_ | 8 #ifndef NET_QUIC_QUIC_DISPATCHER_H_ |
| 9 #define NET_QUIC_QUIC_DISPATCHER_H_ | 9 #define NET_QUIC_QUIC_DISPATCHER_H_ |
| 10 | 10 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 protected: | 127 protected: |
| 128 virtual QuicSession* CreateQuicSession(QuicConnectionId connection_id, | 128 virtual QuicSession* CreateQuicSession(QuicConnectionId connection_id, |
| 129 const IPEndPoint& server_address, | 129 const IPEndPoint& server_address, |
| 130 const IPEndPoint& client_address); | 130 const IPEndPoint& client_address); |
| 131 | 131 |
| 132 // Called by |framer_visitor_| when the public header has been parsed. | 132 // Called by |framer_visitor_| when the public header has been parsed. |
| 133 virtual bool OnUnauthenticatedPublicHeader( | 133 virtual bool OnUnauthenticatedPublicHeader( |
| 134 const QuicPacketPublicHeader& header); | 134 const QuicPacketPublicHeader& header); |
| 135 | 135 |
| 136 // Called by OnUnauthenticatedPublicHeader when the packet is not for a |
| 137 // connection that the dispatcher has a record of, but is not handled by |
| 138 // certain simple processing rules. This method may apply validity checks to |
| 139 // reject stray packets. If the packet appears to be valid, it calls |
| 140 // CreateQuicSession to create a new session for the packet. Returns the |
| 141 // QuicSession that was created, or nullptr if the packet failed the validity |
| 142 // checks. |
| 143 virtual QuicSession* AdditionalValidityChecksThenCreateSession( |
| 144 const QuicPacketPublicHeader& header, |
| 145 QuicConnectionId connection_id); |
| 146 |
| 136 // Create and return the time wait list manager for this dispatcher, which | 147 // Create and return the time wait list manager for this dispatcher, which |
| 137 // will be owned by the dispatcher as time_wait_list_manager_ | 148 // will be owned by the dispatcher as time_wait_list_manager_ |
| 138 virtual QuicTimeWaitListManager* CreateQuicTimeWaitListManager(); | 149 virtual QuicTimeWaitListManager* CreateQuicTimeWaitListManager(); |
| 139 | 150 |
| 140 QuicTimeWaitListManager* time_wait_list_manager() { | 151 QuicTimeWaitListManager* time_wait_list_manager() { |
| 141 return time_wait_list_manager_.get(); | 152 return time_wait_list_manager_.get(); |
| 142 } | 153 } |
| 143 | 154 |
| 144 const QuicVersionVector& supported_versions() const { | 155 const QuicVersionVector& supported_versions() const { |
| 145 return supported_versions_; | 156 return supported_versions_; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 | 252 |
| 242 QuicFramer framer_; | 253 QuicFramer framer_; |
| 243 scoped_ptr<QuicFramerVisitor> framer_visitor_; | 254 scoped_ptr<QuicFramerVisitor> framer_visitor_; |
| 244 | 255 |
| 245 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); | 256 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); |
| 246 }; | 257 }; |
| 247 | 258 |
| 248 } // namespace net | 259 } // namespace net |
| 249 | 260 |
| 250 #endif // NET_QUIC_QUIC_DISPATCHER_H_ | 261 #endif // NET_QUIC_QUIC_DISPATCHER_H_ |
| OLD | NEW |