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 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // QuicSession::Visitor interface implementation (via inheritance of | 83 // QuicSession::Visitor interface implementation (via inheritance of |
84 // QuicTimeWaitListManager::Visitor): | 84 // QuicTimeWaitListManager::Visitor): |
85 // Queues the blocked writer for later resumption. | 85 // Queues the blocked writer for later resumption. |
86 void OnWriteBlocked(QuicBlockedWriterInterface* blocked_writer) override; | 86 void OnWriteBlocked(QuicBlockedWriterInterface* blocked_writer) override; |
87 | 87 |
88 // QuicSession::Visitor interface implementation (via inheritance of | 88 // QuicSession::Visitor interface implementation (via inheritance of |
89 // QuicTimeWaitListManager::Visitor): | 89 // QuicTimeWaitListManager::Visitor): |
90 // Collects reset error code received on streams. | 90 // Collects reset error code received on streams. |
91 void OnRstStreamReceived(const QuicRstStreamFrame& frame) override; | 91 void OnRstStreamReceived(const QuicRstStreamFrame& frame) override; |
92 | 92 |
| 93 void OnPushPromiseSent() override; |
| 94 |
93 // QuicTimeWaitListManager::Visitor interface implementation | 95 // QuicTimeWaitListManager::Visitor interface implementation |
94 // Called whenever the time wait list manager adds a new connection to the | 96 // Called whenever the time wait list manager adds a new connection to the |
95 // time-wait list. | 97 // time-wait list. |
96 void OnConnectionAddedToTimeWaitList(QuicConnectionId connection_id) override; | 98 void OnConnectionAddedToTimeWaitList(QuicConnectionId connection_id) override; |
97 | 99 |
98 using SessionMap = | 100 using SessionMap = |
99 std::unordered_map<QuicConnectionId, std::unique_ptr<QuicSession>>; | 101 std::unordered_map<QuicConnectionId, std::unique_ptr<QuicSession>>; |
100 | 102 |
101 const SessionMap& session_map() const { return session_map_; } | 103 const SessionMap& session_map() const { return session_map_; } |
102 | 104 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 void OnExpiredPackets(QuicConnectionId connection_id, | 155 void OnExpiredPackets(QuicConnectionId connection_id, |
154 QuicBufferedPacketStore::BufferedPacketList | 156 QuicBufferedPacketStore::BufferedPacketList |
155 early_arrived_packets) override; | 157 early_arrived_packets) override; |
156 | 158 |
157 // Create connections for previously buffered CHLOs as many as allowed. | 159 // Create connections for previously buffered CHLOs as many as allowed. |
158 virtual void ProcessBufferedChlos(size_t max_connections_to_create); | 160 virtual void ProcessBufferedChlos(size_t max_connections_to_create); |
159 | 161 |
160 // Return true if there is CHLO buffered. | 162 // Return true if there is CHLO buffered. |
161 virtual bool HasChlosBuffered() const; | 163 virtual bool HasChlosBuffered() const; |
162 | 164 |
| 165 int num_push_promise_sent_; |
| 166 |
163 protected: | 167 protected: |
164 virtual QuicSession* CreateQuicSession( | 168 virtual QuicSession* CreateQuicSession( |
165 QuicConnectionId connection_id, | 169 QuicConnectionId connection_id, |
166 const QuicSocketAddress& client_address) = 0; | 170 const QuicSocketAddress& client_address) = 0; |
167 | 171 |
168 // Called when a connection is rejected statelessly. | 172 // Called when a connection is rejected statelessly. |
169 virtual void OnConnectionRejectedStatelessly(); | 173 virtual void OnConnectionRejectedStatelessly(); |
170 | 174 |
171 // Called when a connection is closed statelessly. | 175 // Called when a connection is closed statelessly. |
172 virtual void OnConnectionClosedStatelessly(QuicErrorCode error); | 176 virtual void OnConnectionClosedStatelessly(QuicErrorCode error); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 // A backward counter of how many new sessions can be create within current | 393 // A backward counter of how many new sessions can be create within current |
390 // event loop. When reaches 0, it means can't create sessions for now. | 394 // event loop. When reaches 0, it means can't create sessions for now. |
391 int16_t new_sessions_allowed_per_event_loop_; | 395 int16_t new_sessions_allowed_per_event_loop_; |
392 | 396 |
393 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); | 397 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); |
394 }; | 398 }; |
395 | 399 |
396 } // namespace net | 400 } // namespace net |
397 | 401 |
398 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ | 402 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ |
OLD | NEW |