OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 map manages packets which are transmitted across multiple paths. | 5 // A map manages packets which are transmitted across multiple paths. |
6 // For example, a packet is originally transmitted on path 1 with packet number | 6 // For example, a packet is originally transmitted on path 1 with packet number |
7 // 1. Then this packet is retransmitted on path 2 with packet number 1. (1, 1) | 7 // 1. Then this packet is retransmitted on path 2 with packet number 1. (1, 1) |
8 // and (2, 1) are inserted into this map. Suppose (2, 1) is detected lost and | 8 // and (2, 1) are inserted into this map. Suppose (2, 1) is detected lost and |
9 // gets retransmitted on path 2 with packet 2. (2, 2) will not be inserted | 9 // gets retransmitted on path 2 with packet 2. (2, 2) will not be inserted |
10 // because this transmission does not "across" path compared to (2, 1). | 10 // because this transmission does not "across" path compared to (2, 1). |
11 | 11 |
12 #ifndef NET_QUIC_QUIC_MULTIPATH_TRANSMISSIONS_MAP_H_ | 12 #ifndef NET_QUIC_QUIC_MULTIPATH_TRANSMISSIONS_MAP_H_ |
13 #define NET_QUIC_QUIC_MULTIPATH_TRANSMISSIONS_MAP_H_ | 13 #define NET_QUIC_QUIC_MULTIPATH_TRANSMISSIONS_MAP_H_ |
14 | 14 |
15 #include <deque> | 15 #include <deque> |
16 #include <unordered_map> | 16 #include <unordered_map> |
17 | 17 |
18 #include "base/macros.h" | 18 #include "base/macros.h" |
19 #include "net/quic/quic_protocol.h" | 19 #include "net/quic/core/quic_protocol.h" |
20 #include "net/quic/quic_utils.h" | 20 #include "net/quic/core/quic_utils.h" |
21 | 21 |
22 namespace net { | 22 namespace net { |
23 | 23 |
24 typedef std::pair<QuicPathId, QuicPacketNumber> QuicPathIdPacketNumber; | 24 typedef std::pair<QuicPathId, QuicPacketNumber> QuicPathIdPacketNumber; |
25 | 25 |
26 class NET_EXPORT_PRIVATE QuicMultipathTransmissionsMap { | 26 class NET_EXPORT_PRIVATE QuicMultipathTransmissionsMap { |
27 public: | 27 public: |
28 struct QuicPathIdPacketNumberHash { | 28 struct QuicPathIdPacketNumberHash { |
29 size_t operator()(std::pair<QuicPathId, QuicPacketNumber> value) const { | 29 size_t operator()(std::pair<QuicPathId, QuicPacketNumber> value) const { |
30 return QuicUtils::PackPathIdAndPacketNumber(value.first, value.second); | 30 return QuicUtils::PackPathIdAndPacketNumber(value.first, value.second); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // packet has been transmitted as (1, 1) and (2, 1), two entries are added | 64 // packet has been transmitted as (1, 1) and (2, 1), two entries are added |
65 // to this map and both values point to the same list: {(1, 1), (2, 1)}. | 65 // to this map and both values point to the same list: {(1, 1), (2, 1)}. |
66 // The MultipathTransmissionsList is owned by the transmission which is | 66 // The MultipathTransmissionsList is owned by the transmission which is |
67 // received first (on any path). | 67 // received first (on any path). |
68 MultipathTransmissionsMap transmission_map_; | 68 MultipathTransmissionsMap transmission_map_; |
69 }; | 69 }; |
70 | 70 |
71 } // namespace net | 71 } // namespace net |
72 | 72 |
73 #endif // NET_QUIC_QUIC_MULTIPATH_TRANSMISSIONS_MAP_H_ | 73 #endif // NET_QUIC_QUIC_MULTIPATH_TRANSMISSIONS_MAP_H_ |
OLD | NEW |