blob: bef5f286d238983fa70e654e5283b025c5effabb [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// 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 "net/third_party/quiche/src/quic/core/frames/quic_crypto_frame.h"
6
7#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
QUICHE teamd9b8aba2019-12-11 10:13:38 -08008#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
QUICHE teama6ef0a62019-03-07 20:34:33 -05009
10namespace quic {
11
QUICHE teama6ef0a62019-03-07 20:34:33 -050012QuicCryptoFrame::QuicCryptoFrame(EncryptionLevel level,
13 QuicStreamOffset offset,
14 QuicPacketLength data_length)
15 : QuicCryptoFrame(level, offset, nullptr, data_length) {}
16
17QuicCryptoFrame::QuicCryptoFrame(EncryptionLevel level,
18 QuicStreamOffset offset,
QUICHE teamd9b8aba2019-12-11 10:13:38 -080019 quiche::QuicheStringPiece data)
QUICHE teama6ef0a62019-03-07 20:34:33 -050020 : QuicCryptoFrame(level, offset, data.data(), data.length()) {}
21
22QuicCryptoFrame::QuicCryptoFrame(EncryptionLevel level,
23 QuicStreamOffset offset,
24 const char* data_buffer,
25 QuicPacketLength data_length)
26 : level(level),
27 data_length(data_length),
28 data_buffer(data_buffer),
29 offset(offset) {}
30
31QuicCryptoFrame::~QuicCryptoFrame() {}
32
33std::ostream& operator<<(std::ostream& os,
34 const QuicCryptoFrame& stream_frame) {
renjietangb4ebb1d2020-05-27 18:15:51 -070035 os << "{ level: " << stream_frame.level << ", offset: " << stream_frame.offset
QUICHE teama6ef0a62019-03-07 20:34:33 -050036 << ", length: " << stream_frame.data_length << " }\n";
37 return os;
38}
39
40} // namespace quic