| 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 <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
| 14 #include "base/macros.h" | 15 #include "base/macros.h" |
| 15 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 16 #include "net/base/ip_endpoint.h" | 17 #include "net/base/ip_endpoint.h" |
| 17 #include "net/base/linked_hash_map.h" | 18 #include "net/base/linked_hash_map.h" |
| 18 #include "net/quic/quic_blocked_writer_interface.h" | 19 #include "net/quic/quic_blocked_writer_interface.h" |
| 19 #include "net/quic/quic_connection.h" | 20 #include "net/quic/quic_connection.h" |
| 20 #include "net/quic/quic_protocol.h" | 21 #include "net/quic/quic_protocol.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 81 |
| 81 // Called whenever the time wait list manager adds a new connection to the | 82 // Called whenever the time wait list manager adds a new connection to the |
| 82 // time-wait list. | 83 // time-wait list. |
| 83 void OnConnectionAddedToTimeWaitList(QuicConnectionId connection_id) override; | 84 void OnConnectionAddedToTimeWaitList(QuicConnectionId connection_id) override; |
| 84 | 85 |
| 85 // Called whenever the time wait list manager removes an old connection from | 86 // Called whenever the time wait list manager removes an old connection from |
| 86 // the time-wait list. | 87 // the time-wait list. |
| 87 void OnConnectionRemovedFromTimeWaitList( | 88 void OnConnectionRemovedFromTimeWaitList( |
| 88 QuicConnectionId connection_id) override; | 89 QuicConnectionId connection_id) override; |
| 89 | 90 |
| 90 typedef base::hash_map<QuicConnectionId, QuicServerSessionBase*> SessionMap; | 91 typedef std::unordered_map<QuicConnectionId, QuicServerSessionBase*> |
| 92 SessionMap; |
| 91 | 93 |
| 92 const SessionMap& session_map() const { return session_map_; } | 94 const SessionMap& session_map() const { return session_map_; } |
| 93 | 95 |
| 94 // Deletes all sessions on the closed session list and clears the list. | 96 // Deletes all sessions on the closed session list and clears the list. |
| 95 void DeleteSessions(); | 97 void DeleteSessions(); |
| 96 | 98 |
| 97 // The largest packet number we expect to receive with a connection | 99 // The largest packet number we expect to receive with a connection |
| 98 // ID for a connection that is not established yet. The current design will | 100 // ID for a connection that is not established yet. The current design will |
| 99 // send a handshake and then up to 50 or so data packets, and then it may | 101 // send a handshake and then up to 50 or so data packets, and then it may |
| 100 // resend the handshake packet up to 10 times. (Retransmitted packets are | 102 // resend the handshake packet up to 10 times. (Retransmitted packets are |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 // The last error set by SetLastError(), which is called by | 258 // The last error set by SetLastError(), which is called by |
| 257 // framer_visitor_->OnError(). | 259 // framer_visitor_->OnError(). |
| 258 QuicErrorCode last_error_; | 260 QuicErrorCode last_error_; |
| 259 | 261 |
| 260 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); | 262 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); |
| 261 }; | 263 }; |
| 262 | 264 |
| 263 } // namespace net | 265 } // namespace net |
| 264 | 266 |
| 265 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ | 267 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ |
| OLD | NEW |