| 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 // Responsible for generating packets on behalf of a QuicConnection. | 5 // Responsible for generating packets on behalf of a QuicConnection. |
| 6 // Packets are serialized just-in-time. Control frames are queued. | 6 // Packets are serialized just-in-time. Control frames are queued. |
| 7 // Ack and Feedback frames will be requested from the Connection | 7 // Ack and Feedback frames will be requested from the Connection |
| 8 // just-in-time. When a packet needs to be sent, the Generator | 8 // just-in-time. When a packet needs to be sent, the Generator |
| 9 // will serialize a packet and pass it to QuicConnection::SendOrQueuePacket() | 9 // will serialize a packet and pass it to QuicConnection::SendOrQueuePacket() |
| 10 // | 10 // |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 class NET_EXPORT_PRIVATE DelegateInterface { | 64 class NET_EXPORT_PRIVATE DelegateInterface { |
| 65 public: | 65 public: |
| 66 virtual ~DelegateInterface() {} | 66 virtual ~DelegateInterface() {} |
| 67 virtual bool CanWrite(Retransmission retransmission, | 67 virtual bool CanWrite(Retransmission retransmission, |
| 68 HasRetransmittableData retransmittable, | 68 HasRetransmittableData retransmittable, |
| 69 IsHandshake handshake) = 0; | 69 IsHandshake handshake) = 0; |
| 70 virtual QuicAckFrame* CreateAckFrame() = 0; | 70 virtual QuicAckFrame* CreateAckFrame() = 0; |
| 71 virtual QuicCongestionFeedbackFrame* CreateFeedbackFrame() = 0; | 71 virtual QuicCongestionFeedbackFrame* CreateFeedbackFrame() = 0; |
| 72 // Takes ownership of |packet.packet| and |packet.retransmittable_frames|. | 72 // Takes ownership of |packet.packet| and |packet.retransmittable_frames|. |
| 73 virtual bool OnSerializedPacket(const SerializedPacket& packet) = 0; | 73 virtual bool OnSerializedPacket(const SerializedPacket& packet) = 0; |
| 74 virtual void CloseConnection(QuicErrorCode error, bool from_peer) = 0; |
| 74 }; | 75 }; |
| 75 | 76 |
| 76 // Interface which gets callbacks from the QuicPacketGenerator at interesting | 77 // Interface which gets callbacks from the QuicPacketGenerator at interesting |
| 77 // points. Implementations must not mutate the state of the generator | 78 // points. Implementations must not mutate the state of the generator |
| 78 // as a result of these callbacks. | 79 // as a result of these callbacks. |
| 79 class NET_EXPORT_PRIVATE DebugDelegateInterface { | 80 class NET_EXPORT_PRIVATE DebugDelegateInterface { |
| 80 public: | 81 public: |
| 81 virtual ~DebugDelegateInterface() {} | 82 virtual ~DebugDelegateInterface() {} |
| 82 | 83 |
| 83 // Called when a frame has been added to the current packet. | 84 // Called when a frame has been added to the current packet. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 // can later be (optionally) retransmitted. | 158 // can later be (optionally) retransmitted. |
| 158 scoped_ptr<QuicAckFrame> pending_ack_frame_; | 159 scoped_ptr<QuicAckFrame> pending_ack_frame_; |
| 159 scoped_ptr<QuicCongestionFeedbackFrame> pending_feedback_frame_; | 160 scoped_ptr<QuicCongestionFeedbackFrame> pending_feedback_frame_; |
| 160 | 161 |
| 161 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); | 162 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); |
| 162 }; | 163 }; |
| 163 | 164 |
| 164 } // namespace net | 165 } // namespace net |
| 165 | 166 |
| 166 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ | 167 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ |
| OLD | NEW |