xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/quic/core/frames/quic_path_response_frame.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright (c) 2018 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_path_response_frame.h"
6 
7 #include "absl/strings/escaping.h"
8 #include "quiche/quic/platform/api/quic_bug_tracker.h"
9 
10 namespace quic {
11 
QuicPathResponseFrame()12 QuicPathResponseFrame::QuicPathResponseFrame()
13     : QuicInlinedFrame(PATH_RESPONSE_FRAME) {}
14 
QuicPathResponseFrame(QuicControlFrameId control_frame_id,const QuicPathFrameBuffer & data_buff)15 QuicPathResponseFrame::QuicPathResponseFrame(
16     QuicControlFrameId control_frame_id, const QuicPathFrameBuffer& data_buff)
17     : QuicInlinedFrame(PATH_RESPONSE_FRAME),
18       control_frame_id(control_frame_id) {
19   memcpy(data_buffer.data(), data_buff.data(), data_buffer.size());
20 }
21 
operator <<(std::ostream & os,const QuicPathResponseFrame & frame)22 std::ostream& operator<<(std::ostream& os, const QuicPathResponseFrame& frame) {
23   os << "{ control_frame_id: " << frame.control_frame_id << ", data: "
24      << absl::BytesToHexString(absl::string_view(
25             reinterpret_cast<const char*>(frame.data_buffer.data()),
26             frame.data_buffer.size()))
27      << " }\n";
28   return os;
29 }
30 
31 }  // namespace quic
32