| 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 // The entity that handles framing writes for a Quic client or server. | 5 // The entity that handles framing writes for a Quic client or server. |
| 6 // Each QuicSession will have a connection associated with it. | 6 // Each QuicSession will have a connection associated with it. |
| 7 // | 7 // |
| 8 // On the server side, the Dispatcher handles the raw reads, and hands off | 8 // On the server side, the Dispatcher handles the raw reads, and hands off |
| 9 // packets via ProcessUdpPacket for framing and processing. | 9 // packets via ProcessUdpPacket for framing and processing. |
| 10 // | 10 // |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // points. Implementations must not mutate the state of the connection | 109 // points. Implementations must not mutate the state of the connection |
| 110 // as a result of these callbacks. | 110 // as a result of these callbacks. |
| 111 class NET_EXPORT_PRIVATE QuicConnectionDebugVisitorInterface | 111 class NET_EXPORT_PRIVATE QuicConnectionDebugVisitorInterface |
| 112 : public QuicPacketGenerator::DebugDelegateInterface { | 112 : public QuicPacketGenerator::DebugDelegateInterface { |
| 113 public: | 113 public: |
| 114 virtual ~QuicConnectionDebugVisitorInterface() {} | 114 virtual ~QuicConnectionDebugVisitorInterface() {} |
| 115 | 115 |
| 116 // Called when a packet has been sent. | 116 // Called when a packet has been sent. |
| 117 virtual void OnPacketSent(QuicPacketSequenceNumber sequence_number, | 117 virtual void OnPacketSent(QuicPacketSequenceNumber sequence_number, |
| 118 EncryptionLevel level, | 118 EncryptionLevel level, |
| 119 TransmissionType transmission_type, |
| 119 const QuicEncryptedPacket& packet, | 120 const QuicEncryptedPacket& packet, |
| 120 WriteResult result) = 0; | 121 WriteResult result) {} |
| 121 | 122 |
| 122 // Called when the contents of a packet have been retransmitted as | 123 // Called when the contents of a packet have been retransmitted as |
| 123 // a new packet. | 124 // a new packet. |
| 124 virtual void OnPacketRetransmitted( | 125 virtual void OnPacketRetransmitted( |
| 125 QuicPacketSequenceNumber old_sequence_number, | 126 QuicPacketSequenceNumber old_sequence_number, |
| 126 QuicPacketSequenceNumber new_sequence_number) = 0; | 127 QuicPacketSequenceNumber new_sequence_number) {} |
| 127 | 128 |
| 128 // Called when a packet has been received, but before it is | 129 // Called when a packet has been received, but before it is |
| 129 // validated or parsed. | 130 // validated or parsed. |
| 130 virtual void OnPacketReceived(const IPEndPoint& self_address, | 131 virtual void OnPacketReceived(const IPEndPoint& self_address, |
| 131 const IPEndPoint& peer_address, | 132 const IPEndPoint& peer_address, |
| 132 const QuicEncryptedPacket& packet) = 0; | 133 const QuicEncryptedPacket& packet) {} |
| 133 | 134 |
| 134 // Called when the protocol version on the received packet doensn't match | 135 // Called when the protocol version on the received packet doensn't match |
| 135 // current protocol version of the connection. | 136 // current protocol version of the connection. |
| 136 virtual void OnProtocolVersionMismatch(QuicVersion version) = 0; | 137 virtual void OnProtocolVersionMismatch(QuicVersion version) {} |
| 137 | 138 |
| 138 // Called when the complete header of a packet has been parsed. | 139 // Called when the complete header of a packet has been parsed. |
| 139 virtual void OnPacketHeader(const QuicPacketHeader& header) = 0; | 140 virtual void OnPacketHeader(const QuicPacketHeader& header) {} |
| 140 | 141 |
| 141 // Called when a StreamFrame has been parsed. | 142 // Called when a StreamFrame has been parsed. |
| 142 virtual void OnStreamFrame(const QuicStreamFrame& frame) = 0; | 143 virtual void OnStreamFrame(const QuicStreamFrame& frame) {} |
| 143 | 144 |
| 144 // Called when a AckFrame has been parsed. | 145 // Called when a AckFrame has been parsed. |
| 145 virtual void OnAckFrame(const QuicAckFrame& frame) = 0; | 146 virtual void OnAckFrame(const QuicAckFrame& frame) {} |
| 146 | 147 |
| 147 // Called when a CongestionFeedbackFrame has been parsed. | 148 // Called when a CongestionFeedbackFrame has been parsed. |
| 148 virtual void OnCongestionFeedbackFrame( | 149 virtual void OnCongestionFeedbackFrame( |
| 149 const QuicCongestionFeedbackFrame& frame) = 0; | 150 const QuicCongestionFeedbackFrame& frame) {} |
| 150 | 151 |
| 151 // Called when a StopWaitingFrame has been parsed. | 152 // Called when a StopWaitingFrame has been parsed. |
| 152 virtual void OnStopWaitingFrame(const QuicStopWaitingFrame& frame) = 0; | 153 virtual void OnStopWaitingFrame(const QuicStopWaitingFrame& frame) {} |
| 153 | 154 |
| 154 // Called when a RstStreamFrame has been parsed. | 155 // Called when a RstStreamFrame has been parsed. |
| 155 virtual void OnRstStreamFrame(const QuicRstStreamFrame& frame) = 0; | 156 virtual void OnRstStreamFrame(const QuicRstStreamFrame& frame) {} |
| 156 | 157 |
| 157 // Called when a ConnectionCloseFrame has been parsed. | 158 // Called when a ConnectionCloseFrame has been parsed. |
| 158 virtual void OnConnectionCloseFrame( | 159 virtual void OnConnectionCloseFrame( |
| 159 const QuicConnectionCloseFrame& frame) = 0; | 160 const QuicConnectionCloseFrame& frame) {} |
| 160 | 161 |
| 161 // Called when a public reset packet has been received. | 162 // Called when a public reset packet has been received. |
| 162 virtual void OnPublicResetPacket(const QuicPublicResetPacket& packet) = 0; | 163 virtual void OnPublicResetPacket(const QuicPublicResetPacket& packet) {} |
| 163 | 164 |
| 164 // Called when a version negotiation packet has been received. | 165 // Called when a version negotiation packet has been received. |
| 165 virtual void OnVersionNegotiationPacket( | 166 virtual void OnVersionNegotiationPacket( |
| 166 const QuicVersionNegotiationPacket& packet) = 0; | 167 const QuicVersionNegotiationPacket& packet) {} |
| 167 | 168 |
| 168 // Called after a packet has been successfully parsed which results | 169 // Called after a packet has been successfully parsed which results |
| 169 // in the revival of a packet via FEC. | 170 // in the revival of a packet via FEC. |
| 170 virtual void OnRevivedPacket(const QuicPacketHeader& revived_header, | 171 virtual void OnRevivedPacket(const QuicPacketHeader& revived_header, |
| 171 base::StringPiece payload) = 0; | 172 base::StringPiece payload) {} |
| 172 }; | 173 }; |
| 173 | 174 |
| 174 class NET_EXPORT_PRIVATE QuicConnectionHelperInterface { | 175 class NET_EXPORT_PRIVATE QuicConnectionHelperInterface { |
| 175 public: | 176 public: |
| 176 virtual ~QuicConnectionHelperInterface() {} | 177 virtual ~QuicConnectionHelperInterface() {} |
| 177 | 178 |
| 178 // Returns a QuicClock to be used for all time related functions. | 179 // Returns a QuicClock to be used for all time related functions. |
| 179 virtual const QuicClock* GetClock() const = 0; | 180 virtual const QuicClock* GetClock() const = 0; |
| 180 | 181 |
| 181 // Returns a QuicRandom to be used for all random number related functions. | 182 // Returns a QuicRandom to be used for all random number related functions. |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 // If non-empty this contains the set of versions received in a | 713 // If non-empty this contains the set of versions received in a |
| 713 // version negotiation packet. | 714 // version negotiation packet. |
| 714 QuicVersionVector server_supported_versions_; | 715 QuicVersionVector server_supported_versions_; |
| 715 | 716 |
| 716 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 717 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
| 717 }; | 718 }; |
| 718 | 719 |
| 719 } // namespace net | 720 } // namespace net |
| 720 | 721 |
| 721 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 722 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
| OLD | NEW |