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 |
| 11 #include <memory> |
11 #include <unordered_map> | 12 #include <unordered_map> |
12 #include <vector> | 13 #include <vector> |
13 | 14 |
14 #include "base/containers/hash_tables.h" | 15 #include "base/containers/hash_tables.h" |
15 #include "base/macros.h" | 16 #include "base/macros.h" |
16 #include "base/memory/scoped_ptr.h" | |
17 #include "net/base/ip_endpoint.h" | 17 #include "net/base/ip_endpoint.h" |
18 #include "net/base/linked_hash_map.h" | 18 #include "net/base/linked_hash_map.h" |
19 #include "net/quic/crypto/quic_compressed_certs_cache.h" | 19 #include "net/quic/crypto/quic_compressed_certs_cache.h" |
20 #include "net/quic/quic_blocked_writer_interface.h" | 20 #include "net/quic/quic_blocked_writer_interface.h" |
21 #include "net/quic/quic_connection.h" | 21 #include "net/quic/quic_connection.h" |
22 #include "net/quic/quic_protocol.h" | 22 #include "net/quic/quic_protocol.h" |
23 #include "net/tools/quic/quic_process_packet_interface.h" | 23 #include "net/tools/quic/quic_process_packet_interface.h" |
24 #include "net/tools/quic/quic_server_session_base.h" | 24 #include "net/tools/quic/quic_server_session_base.h" |
25 #include "net/tools/quic/quic_time_wait_list_manager.h" | 25 #include "net/tools/quic/quic_time_wait_list_manager.h" |
26 | 26 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 | 228 |
229 // The cache for most recently compressed certs. | 229 // The cache for most recently compressed certs. |
230 QuicCompressedCertsCache compressed_certs_cache_; | 230 QuicCompressedCertsCache compressed_certs_cache_; |
231 | 231 |
232 // The list of connections waiting to write. | 232 // The list of connections waiting to write. |
233 WriteBlockedList write_blocked_list_; | 233 WriteBlockedList write_blocked_list_; |
234 | 234 |
235 SessionMap session_map_; | 235 SessionMap session_map_; |
236 | 236 |
237 // Entity that manages connection_ids in time wait state. | 237 // Entity that manages connection_ids in time wait state. |
238 scoped_ptr<QuicTimeWaitListManager> time_wait_list_manager_; | 238 std::unique_ptr<QuicTimeWaitListManager> time_wait_list_manager_; |
239 | 239 |
240 // The list of closed but not-yet-deleted sessions. | 240 // The list of closed but not-yet-deleted sessions. |
241 std::vector<QuicServerSessionBase*> closed_session_list_; | 241 std::vector<QuicServerSessionBase*> closed_session_list_; |
242 | 242 |
243 // The helper used for all connections. | 243 // The helper used for all connections. |
244 scoped_ptr<QuicConnectionHelperInterface> helper_; | 244 std::unique_ptr<QuicConnectionHelperInterface> helper_; |
245 | 245 |
246 // An alarm which deletes closed sessions. | 246 // An alarm which deletes closed sessions. |
247 scoped_ptr<QuicAlarm> delete_sessions_alarm_; | 247 std::unique_ptr<QuicAlarm> delete_sessions_alarm_; |
248 | 248 |
249 // The writer to write to the socket with. | 249 // The writer to write to the socket with. |
250 scoped_ptr<QuicPacketWriter> writer_; | 250 std::unique_ptr<QuicPacketWriter> writer_; |
251 | 251 |
252 // This vector contains QUIC versions which we currently support. | 252 // This vector contains QUIC versions which we currently support. |
253 // This should be ordered such that the highest supported version is the first | 253 // This should be ordered such that the highest supported version is the first |
254 // element, with subsequent elements in descending order (versions can be | 254 // element, with subsequent elements in descending order (versions can be |
255 // skipped as necessary). | 255 // skipped as necessary). |
256 const QuicVersionVector supported_versions_; | 256 const QuicVersionVector supported_versions_; |
257 | 257 |
258 // Information about the packet currently being handled. | 258 // Information about the packet currently being handled. |
259 IPEndPoint current_client_address_; | 259 IPEndPoint current_client_address_; |
260 IPEndPoint current_server_address_; | 260 IPEndPoint current_server_address_; |
261 const QuicReceivedPacket* current_packet_; | 261 const QuicReceivedPacket* current_packet_; |
262 QuicConnectionId current_connection_id_; | 262 QuicConnectionId current_connection_id_; |
263 | 263 |
264 QuicFramer framer_; | 264 QuicFramer framer_; |
265 | 265 |
266 // The last error set by SetLastError(), which is called by | 266 // The last error set by SetLastError(), which is called by |
267 // framer_visitor_->OnError(). | 267 // framer_visitor_->OnError(). |
268 QuicErrorCode last_error_; | 268 QuicErrorCode last_error_; |
269 | 269 |
270 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); | 270 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); |
271 }; | 271 }; |
272 | 272 |
273 } // namespace net | 273 } // namespace net |
274 | 274 |
275 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ | 275 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ |
OLD | NEW |