| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // QuicBlockedWriterInterface implementation: | 88 // QuicBlockedWriterInterface implementation: |
| 89 // Called when the socket becomes writable to allow queued writes to happen. | 89 // Called when the socket becomes writable to allow queued writes to happen. |
| 90 virtual void OnCanWrite() OVERRIDE; | 90 virtual void OnCanWrite() OVERRIDE; |
| 91 | 91 |
| 92 // QuicServerSessionVisitor interface implementation: | 92 // QuicServerSessionVisitor interface implementation: |
| 93 // Ensure that the closed connection is cleaned up asynchronously. | 93 // Ensure that the closed connection is cleaned up asynchronously. |
| 94 virtual void OnConnectionClosed(QuicConnectionId connection_id, | 94 virtual void OnConnectionClosed(QuicConnectionId connection_id, |
| 95 QuicErrorCode error) OVERRIDE; | 95 QuicErrorCode error) OVERRIDE; |
| 96 | 96 |
| 97 // Queues the blocked writer for later resumption. | 97 // Queues the blocked writer for later resumption. |
| 98 virtual void OnWriteBlocked(QuicBlockedWriterInterface* writer) OVERRIDE; | 98 virtual void OnWriteBlocked( |
| 99 QuicBlockedWriterInterface* blocked_writer) OVERRIDE; |
| 99 | 100 |
| 100 typedef base::hash_map<QuicConnectionId, QuicSession*> SessionMap; | 101 typedef base::hash_map<QuicConnectionId, QuicSession*> SessionMap; |
| 101 | 102 |
| 102 // Deletes all sessions on the closed session list and clears the list. | 103 // Deletes all sessions on the closed session list and clears the list. |
| 103 void DeleteSessions(); | 104 void DeleteSessions(); |
| 104 | 105 |
| 105 const SessionMap& session_map() const { return session_map_; } | 106 const SessionMap& session_map() const { return session_map_; } |
| 106 | 107 |
| 107 WriteBlockedList* write_blocked_list() { return &write_blocked_list_; } | |
| 108 | |
| 109 protected: | 108 protected: |
| 110 virtual QuicSession* CreateQuicSession(QuicConnectionId connection_id, | 109 virtual QuicSession* CreateQuicSession(QuicConnectionId connection_id, |
| 111 const IPEndPoint& server_address, | 110 const IPEndPoint& server_address, |
| 112 const IPEndPoint& client_address); | 111 const IPEndPoint& client_address); |
| 113 | 112 |
| 114 virtual QuicConnection* CreateQuicConnection( | 113 virtual QuicConnection* CreateQuicConnection( |
| 115 QuicConnectionId connection_id, | 114 QuicConnectionId connection_id, |
| 116 const IPEndPoint& server_address, | 115 const IPEndPoint& server_address, |
| 117 const IPEndPoint& client_address, | 116 const IPEndPoint& client_address, |
| 118 QuicPerConnectionPacketWriter* writer); | 117 QuicPerConnectionPacketWriter* writer); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 221 |
| 223 QuicFramer framer_; | 222 QuicFramer framer_; |
| 224 scoped_ptr<QuicFramerVisitor> framer_visitor_; | 223 scoped_ptr<QuicFramerVisitor> framer_visitor_; |
| 225 | 224 |
| 226 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); | 225 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); |
| 227 }; | 226 }; |
| 228 | 227 |
| 229 } // namespace net | 228 } // namespace net |
| 230 | 229 |
| 231 #endif // NET_QUIC_QUIC_DISPATCHER_H_ | 230 #endif // NET_QUIC_QUIC_DISPATCHER_H_ |
| OLD | NEW |