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 // Accumulates frames for the next packet until more frames no longer fit or | 5 // Accumulates frames for the next packet until more frames no longer fit or |
6 // it's time to create a packet from them. If multipath enabled, only creates | 6 // it's time to create a packet from them. If multipath enabled, only creates |
7 // packets on one path at the same time. Currently, next packet number is | 7 // packets on one path at the same time. Currently, next packet number is |
8 // tracked per-path. | 8 // tracked per-path. |
9 | 9 |
10 #ifndef NET_QUIC_QUIC_PACKET_CREATOR_H_ | 10 #ifndef NET_QUIC_QUIC_PACKET_CREATOR_H_ |
(...skipping 15 matching lines...) Expand all Loading... |
26 namespace net { | 26 namespace net { |
27 namespace test { | 27 namespace test { |
28 class QuicPacketCreatorPeer; | 28 class QuicPacketCreatorPeer; |
29 } | 29 } |
30 | 30 |
31 class QuicRandom; | 31 class QuicRandom; |
32 | 32 |
33 class NET_EXPORT_PRIVATE QuicPacketCreator { | 33 class NET_EXPORT_PRIVATE QuicPacketCreator { |
34 public: | 34 public: |
35 // A delegate interface for further processing serialized packet. | 35 // A delegate interface for further processing serialized packet. |
36 class NET_EXPORT_PRIVATE DelegateInterface { | 36 class NET_EXPORT_PRIVATE DelegateInterface |
| 37 : public QuicConnectionCloseDelegateInterface { |
37 public: | 38 public: |
38 virtual ~DelegateInterface() {} | 39 ~DelegateInterface() override {} |
39 // Called when a packet is serialized. Delegate does not take the ownership | 40 // Called when a packet is serialized. Delegate does not take the ownership |
40 // of |serialized_packet|, but takes ownership of any frames it removes | 41 // of |serialized_packet|, but takes ownership of any frames it removes |
41 // from |packet.retransmittable_frames|. | 42 // from |packet.retransmittable_frames|. |
42 virtual void OnSerializedPacket(SerializedPacket* serialized_packet) = 0; | 43 virtual void OnSerializedPacket(SerializedPacket* serialized_packet) = 0; |
43 | |
44 // Called when an unrecoverable error is encountered. | |
45 virtual void OnUnrecoverableError(QuicErrorCode error, | |
46 const std::string& error_details, | |
47 ConnectionCloseSource source) = 0; | |
48 }; | 44 }; |
49 | 45 |
50 // Interface which gets callbacks from the QuicPacketCreator at interesting | 46 // Interface which gets callbacks from the QuicPacketCreator at interesting |
51 // points. Implementations must not mutate the state of the creator | 47 // points. Implementations must not mutate the state of the creator |
52 // as a result of these callbacks. | 48 // as a result of these callbacks. |
53 class NET_EXPORT_PRIVATE DebugDelegate { | 49 class NET_EXPORT_PRIVATE DebugDelegate { |
54 public: | 50 public: |
55 virtual ~DebugDelegate() {} | 51 virtual ~DebugDelegate() {} |
56 | 52 |
57 // Called when a frame has been added to the current packet. | 53 // Called when a frame has been added to the current packet. |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 | 345 |
350 // Map mapping path_id to last sent packet number on the path. | 346 // Map mapping path_id to last sent packet number on the path. |
351 std::unordered_map<QuicPathId, QuicPacketNumber> multipath_packet_number_; | 347 std::unordered_map<QuicPathId, QuicPacketNumber> multipath_packet_number_; |
352 | 348 |
353 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); | 349 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); |
354 }; | 350 }; |
355 | 351 |
356 } // namespace net | 352 } // namespace net |
357 | 353 |
358 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ | 354 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ |
OLD | NEW |