1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef QUICHE_QUIC_CORE_FRAMES_QUIC_WINDOW_UPDATE_FRAME_H_ 6 #define QUICHE_QUIC_CORE_FRAMES_QUIC_WINDOW_UPDATE_FRAME_H_ 7 8 #include <ostream> 9 10 #include "quiche/quic/core/frames/quic_inlined_frame.h" 11 #include "quiche/quic/core/quic_constants.h" 12 #include "quiche/quic/core/quic_types.h" 13 14 namespace quic { 15 16 // Flow control updates per-stream and at the connection level. 17 // Based on SPDY's WINDOW_UPDATE frame, but uses an absolute max data bytes 18 // rather than a window delta. 19 struct QUIC_EXPORT_PRIVATE QuicWindowUpdateFrame 20 : public QuicInlinedFrame<QuicWindowUpdateFrame> { 21 QuicWindowUpdateFrame(); 22 QuicWindowUpdateFrame(QuicControlFrameId control_frame_id, 23 QuicStreamId stream_id, QuicByteCount max_data); 24 25 friend QUIC_EXPORT_PRIVATE std::ostream& operator<<( 26 std::ostream& os, const QuicWindowUpdateFrame& w); 27 28 QuicFrameType type; 29 30 // A unique identifier of this control frame. 0 when this frame is received, 31 // and non-zero when sent. 32 QuicControlFrameId control_frame_id = kInvalidControlFrameId; 33 34 // The stream this frame applies to. 0 is a special case meaning the overall 35 // connection rather than a specific stream. 36 QuicStreamId stream_id = 0; 37 38 // Maximum data allowed in the stream or connection. The receiver of this 39 // frame must not send data which would exceedes this restriction. 40 QuicByteCount max_data = 0; 41 }; 42 43 } // namespace quic 44 45 #endif // QUICHE_QUIC_CORE_FRAMES_QUIC_WINDOW_UPDATE_FRAME_H_ 46