| 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 : public QuicConnectionCloseDelegat
eInterface { |
| 37 public: | 37 public: |
| 38 virtual ~DelegateInterface() {} | 38 ~DelegateInterface() override {} |
| 39 // Called when a packet is serialized. Delegate does not take the ownership | 39 // Called when a packet is serialized. Delegate does not take the ownership |
| 40 // of |serialized_packet|, but takes ownership of any frames it removes | 40 // of |serialized_packet|, but takes ownership of any frames it removes |
| 41 // from |packet.retransmittable_frames|. | 41 // from |packet.retransmittable_frames|. |
| 42 virtual void OnSerializedPacket(SerializedPacket* serialized_packet) = 0; | 42 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 }; | 43 }; |
| 49 | 44 |
| 50 // Interface which gets callbacks from the QuicPacketCreator at interesting | 45 // Interface which gets callbacks from the QuicPacketCreator at interesting |
| 51 // points. Implementations must not mutate the state of the creator | 46 // points. Implementations must not mutate the state of the creator |
| 52 // as a result of these callbacks. | 47 // as a result of these callbacks. |
| 53 class NET_EXPORT_PRIVATE DebugDelegate { | 48 class NET_EXPORT_PRIVATE DebugDelegate { |
| 54 public: | 49 public: |
| 55 virtual ~DebugDelegate() {} | 50 virtual ~DebugDelegate() {} |
| 56 | 51 |
| 57 // Called when a frame has been added to the current packet. | 52 // 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 | 344 |
| 350 // Map mapping path_id to last sent packet number on the path. | 345 // Map mapping path_id to last sent packet number on the path. |
| 351 std::unordered_map<QuicPathId, QuicPacketNumber> multipath_packet_number_; | 346 std::unordered_map<QuicPathId, QuicPacketNumber> multipath_packet_number_; |
| 352 | 347 |
| 353 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); | 348 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); |
| 354 }; | 349 }; |
| 355 | 350 |
| 356 } // namespace net | 351 } // namespace net |
| 357 | 352 |
| 358 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ | 353 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ |
| OLD | NEW |