| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 "MTU discovery target does not exceed the default packet size"); | 88 "MTU discovery target does not exceed the default packet size"); |
| 89 static_assert(kMtuDiscoveryTargetPacketSizeHigh > kDefaultMaxPacketSize, | 89 static_assert(kMtuDiscoveryTargetPacketSizeHigh > kDefaultMaxPacketSize, |
| 90 "MTU discovery target does not exceed the default packet size"); | 90 "MTU discovery target does not exceed the default packet size"); |
| 91 | 91 |
| 92 // Class that receives callbacks from the connection when frames are received | 92 // Class that receives callbacks from the connection when frames are received |
| 93 // and when other interesting events happen. | 93 // and when other interesting events happen. |
| 94 class NET_EXPORT_PRIVATE QuicConnectionVisitorInterface { | 94 class NET_EXPORT_PRIVATE QuicConnectionVisitorInterface { |
| 95 public: | 95 public: |
| 96 virtual ~QuicConnectionVisitorInterface() {} | 96 virtual ~QuicConnectionVisitorInterface() {} |
| 97 | 97 |
| 98 // A simple visitor interface for dealing with data frames. | 98 // A simple visitor interface for dealing with a data frame. |
| 99 virtual void OnStreamFrames(const std::vector<QuicStreamFrame>& frames) = 0; | 99 virtual void OnStreamFrame(const QuicStreamFrame& frame) = 0; |
| 100 | 100 |
| 101 // The session should process all WINDOW_UPDATE frames, adjusting both stream | 101 // The session should process the WINDOW_UPDATE frame, adjusting both stream |
| 102 // and connection level flow control windows. | 102 // and connection level flow control windows. |
| 103 virtual void OnWindowUpdateFrames( | 103 virtual void OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) = 0; |
| 104 const std::vector<QuicWindowUpdateFrame>& frames) = 0; | |
| 105 | 104 |
| 106 // BLOCKED frames tell us that the peer believes it is flow control blocked on | 105 // A BLOCKED frame indicates the peer is flow control blocked |
| 107 // a specified stream. If the session at this end disagrees, something has | 106 // on a specified stream. |
| 108 // gone wrong with our flow control accounting. | 107 virtual void OnBlockedFrame(const QuicBlockedFrame& frame) = 0; |
| 109 virtual void OnBlockedFrames(const std::vector<QuicBlockedFrame>& frames) = 0; | |
| 110 | 108 |
| 111 // Called when the stream is reset by the peer. | 109 // Called when the stream is reset by the peer. |
| 112 virtual void OnRstStream(const QuicRstStreamFrame& frame) = 0; | 110 virtual void OnRstStream(const QuicRstStreamFrame& frame) = 0; |
| 113 | 111 |
| 114 // Called when the connection is going away according to the peer. | 112 // Called when the connection is going away according to the peer. |
| 115 virtual void OnGoAway(const QuicGoAwayFrame& frame) = 0; | 113 virtual void OnGoAway(const QuicGoAwayFrame& frame) = 0; |
| 116 | 114 |
| 117 // Called when the connection is closed either locally by the framer, or | 115 // Called when the connection is closed either locally by the framer, or |
| 118 // remotely by the peer. | 116 // remotely by the peer. |
| 119 virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) = 0; | 117 virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) = 0; |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 | 939 |
| 942 // The size of the largest packet received from peer. | 940 // The size of the largest packet received from peer. |
| 943 QuicByteCount largest_received_packet_size_; | 941 QuicByteCount largest_received_packet_size_; |
| 944 | 942 |
| 945 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 943 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
| 946 }; | 944 }; |
| 947 | 945 |
| 948 } // namespace net | 946 } // namespace net |
| 949 | 947 |
| 950 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 948 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
| OLD | NEW |