OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 #ifndef NET_QUIC_QUIC_BUFFERED_PACKET_STORE_H_ | 5 #ifndef NET_QUIC_QUIC_BUFFERED_PACKET_STORE_H_ |
6 #define NET_QUIC_QUIC_BUFFERED_PACKET_STORE_H_ | 6 #define NET_QUIC_QUIC_BUFFERED_PACKET_STORE_H_ |
7 | 7 |
8 #include "net/base/ip_address.h" | 8 #include "net/base/ip_address.h" |
9 #include "net/base/linked_hash_map.h" | 9 #include "net/base/linked_hash_map.h" |
10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 void MaybeSetExpirationAlarm(); | 134 void MaybeSetExpirationAlarm(); |
135 | 135 |
136 // Return true if add an extra packet will go beyond allowed max connection | 136 // Return true if add an extra packet will go beyond allowed max connection |
137 // limit. The limit for non-CHLO packet and CHLO packet is different. | 137 // limit. The limit for non-CHLO packet and CHLO packet is different. |
138 bool ShouldBufferPacket(bool is_chlo); | 138 bool ShouldBufferPacket(bool is_chlo); |
139 | 139 |
140 // A map to store packet queues with creation time for each connection. | 140 // A map to store packet queues with creation time for each connection. |
141 BufferedPacketMap undecryptable_packets_; | 141 BufferedPacketMap undecryptable_packets_; |
142 | 142 |
143 // The max time the packets of a connection can be buffer in the store. | 143 // The max time the packets of a connection can be buffer in the store. |
144 QuicTime::Delta connection_life_span_; | 144 const QuicTime::Delta connection_life_span_; |
145 | 145 |
146 VisitorInterface* visitor_; // Unowned. | 146 VisitorInterface* visitor_; // Unowned. |
147 | 147 |
148 const QuicClock* clock_; // Unowned. | 148 const QuicClock* clock_; // Unowned. |
149 | 149 |
150 // This alarm fires every |connection_life_span_| to clean up | 150 // This alarm fires every |connection_life_span_| to clean up |
151 // packets staying in the store for too long. | 151 // packets staying in the store for too long. |
152 std::unique_ptr<QuicAlarm> expiration_alarm_; | 152 std::unique_ptr<QuicAlarm> expiration_alarm_; |
153 | 153 |
154 // Keeps track of connection with CHLO buffered up already and the order they | 154 // Keeps track of connection with CHLO buffered up already and the order they |
155 // arrive. | 155 // arrive. |
156 linked_hash_map<QuicConnectionId, bool> connections_with_chlo_; | 156 linked_hash_map<QuicConnectionId, bool> connections_with_chlo_; |
157 }; | 157 }; |
158 | 158 |
159 } // namespace net | 159 } // namespace net |
160 | 160 |
161 #endif // NET_QUIC_QUIC_BUFFERED_PACKET_STORE_H_ | 161 #endif // NET_QUIC_QUIC_BUFFERED_PACKET_STORE_H_ |
OLD | NEW |