xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/quic/core/frames/quic_blocked_frame.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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 #include "quiche/quic/core/frames/quic_blocked_frame.h"
6 
7 #include "quiche/quic/core/quic_types.h"
8 
9 namespace quic {
10 
QuicBlockedFrame()11 QuicBlockedFrame::QuicBlockedFrame() : QuicInlinedFrame(BLOCKED_FRAME) {}
12 
QuicBlockedFrame(QuicControlFrameId control_frame_id,QuicStreamId stream_id,QuicStreamOffset offset)13 QuicBlockedFrame::QuicBlockedFrame(QuicControlFrameId control_frame_id,
14                                    QuicStreamId stream_id,
15                                    QuicStreamOffset offset)
16     : QuicInlinedFrame(BLOCKED_FRAME),
17       control_frame_id(control_frame_id),
18       stream_id(stream_id),
19       offset(offset) {}
20 
operator <<(std::ostream & os,const QuicBlockedFrame & blocked_frame)21 std::ostream& operator<<(std::ostream& os,
22                          const QuicBlockedFrame& blocked_frame) {
23   os << "{ control_frame_id: " << blocked_frame.control_frame_id
24      << ", stream_id: " << blocked_frame.stream_id
25      << ", offset: " << blocked_frame.offset << " }\n";
26   return os;
27 }
28 
operator ==(const QuicBlockedFrame & rhs) const29 bool QuicBlockedFrame::operator==(const QuicBlockedFrame& rhs) const {
30   return control_frame_id == rhs.control_frame_id &&
31          stream_id == rhs.stream_id && offset == rhs.offset;
32 }
33 
operator !=(const QuicBlockedFrame & rhs) const34 bool QuicBlockedFrame::operator!=(const QuicBlockedFrame& rhs) const {
35   return !(*this == rhs);
36 }
37 
38 }  // namespace quic
39