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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 public: | 50 public: |
51 // Ideally we'd have a linked_hash_set: the boolean is unused. | 51 // Ideally we'd have a linked_hash_set: the boolean is unused. |
52 typedef linked_hash_map<QuicBlockedWriterInterface*, bool> WriteBlockedList; | 52 typedef linked_hash_map<QuicBlockedWriterInterface*, bool> WriteBlockedList; |
53 | 53 |
54 // Due to the way delete_sessions_closure_ is registered, the Dispatcher | 54 // Due to the way delete_sessions_closure_ is registered, the Dispatcher |
55 // must live until epoll_server Shutdown. |supported_versions| specifies the | 55 // must live until epoll_server Shutdown. |supported_versions| specifies the |
56 // list of supported QUIC versions. | 56 // list of supported QUIC versions. |
57 QuicDispatcher(const QuicConfig& config, | 57 QuicDispatcher(const QuicConfig& config, |
58 const QuicCryptoServerConfig& crypto_config, | 58 const QuicCryptoServerConfig& crypto_config, |
59 const QuicVersionVector& supported_versions, | 59 const QuicVersionVector& supported_versions, |
60 QuicConnectionHelperInterface* helper, | 60 QuicConnectionHelperInterface* helper); |
61 uint32 initial_flow_control_window_bytes); | |
62 | 61 |
63 virtual ~QuicDispatcher(); | 62 virtual ~QuicDispatcher(); |
64 | 63 |
65 // Takes ownership of the packet writer | 64 // Takes ownership of the packet writer |
66 virtual void Initialize(QuicPacketWriter* writer); | 65 virtual void Initialize(QuicPacketWriter* writer); |
67 | 66 |
68 // Process the incoming packet by creating a new session, passing it to | 67 // Process the incoming packet by creating a new session, passing it to |
69 // an existing session, or passing it to the TimeWaitListManager. | 68 // an existing session, or passing it to the TimeWaitListManager. |
70 virtual void ProcessPacket(const IPEndPoint& server_address, | 69 virtual void ProcessPacket(const IPEndPoint& server_address, |
71 const IPEndPoint& client_address, | 70 const IPEndPoint& client_address, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 const QuicConfig& config() const { return config_; } | 149 const QuicConfig& config() const { return config_; } |
151 | 150 |
152 const QuicCryptoServerConfig& crypto_config() const { return crypto_config_; } | 151 const QuicCryptoServerConfig& crypto_config() const { return crypto_config_; } |
153 | 152 |
154 QuicFramer* framer() { return &framer_; } | 153 QuicFramer* framer() { return &framer_; } |
155 | 154 |
156 QuicConnectionHelperInterface* helper() { return helper_; } | 155 QuicConnectionHelperInterface* helper() { return helper_; } |
157 | 156 |
158 QuicPacketWriter* writer() { return writer_.get(); } | 157 QuicPacketWriter* writer() { return writer_.get(); } |
159 | 158 |
160 uint32 initial_flow_control_window_bytes() const { | |
161 return initial_flow_control_window_bytes_; | |
162 } | |
163 | |
164 private: | 159 private: |
165 class QuicFramerVisitor; | 160 class QuicFramerVisitor; |
166 friend class net::test::QuicDispatcherPeer; | 161 friend class net::test::QuicDispatcherPeer; |
167 | 162 |
168 // Called by |framer_visitor_| when the private header has been parsed | 163 // Called by |framer_visitor_| when the private header has been parsed |
169 // of a data packet that is destined for the time wait manager. | 164 // of a data packet that is destined for the time wait manager. |
170 void OnUnauthenticatedHeader(const QuicPacketHeader& header); | 165 void OnUnauthenticatedHeader(const QuicPacketHeader& header); |
171 | 166 |
172 // Removes the session from the session map and write blocked list, and | 167 // Removes the session from the session map and write blocked list, and |
173 // adds the ConnectionId to the time-wait list. | 168 // adds the ConnectionId to the time-wait list. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 QuicVersionVector supported_versions_no_connection_flow_control_; | 215 QuicVersionVector supported_versions_no_connection_flow_control_; |
221 | 216 |
222 // Information about the packet currently being handled. | 217 // Information about the packet currently being handled. |
223 IPEndPoint current_client_address_; | 218 IPEndPoint current_client_address_; |
224 IPEndPoint current_server_address_; | 219 IPEndPoint current_server_address_; |
225 const QuicEncryptedPacket* current_packet_; | 220 const QuicEncryptedPacket* current_packet_; |
226 | 221 |
227 QuicFramer framer_; | 222 QuicFramer framer_; |
228 scoped_ptr<QuicFramerVisitor> framer_visitor_; | 223 scoped_ptr<QuicFramerVisitor> framer_visitor_; |
229 | 224 |
230 // Initial flow control window size to advertize to peer on newly created | |
231 // connections. | |
232 const uint32 initial_flow_control_window_bytes_; | |
233 | |
234 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); | 225 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); |
235 }; | 226 }; |
236 | 227 |
237 } // namespace net | 228 } // namespace net |
238 | 229 |
239 #endif // NET_QUIC_QUIC_DISPATCHER_H_ | 230 #endif // NET_QUIC_QUIC_DISPATCHER_H_ |
OLD | NEW |