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