blob: d750da769397fa8ed25483dc16242ca0329c381d [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
12QuicCryptoFrame::QuicCryptoFrame()
QUICHE team6987b4a2019-03-15 16:23:04 -070013 : QuicCryptoFrame(ENCRYPTION_INITIAL, 0, nullptr, 0) {}
QUICHE teama6ef0a62019-03-07 20:34:33 -050014
15QuicCryptoFrame::QuicCryptoFrame(EncryptionLevel level,
16 QuicStreamOffset offset,
17 QuicPacketLength data_length)
18 : QuicCryptoFrame(level, offset, nullptr, data_length) {}
19
20QuicCryptoFrame::QuicCryptoFrame(EncryptionLevel level,
21 QuicStreamOffset offset,
QUICHE teamd9b8aba2019-12-11 10:13:38 -080022 quiche::QuicheStringPiece data)
QUICHE teama6ef0a62019-03-07 20:34:33 -050023 : QuicCryptoFrame(level, offset, data.data(), data.length()) {}
24
25QuicCryptoFrame::QuicCryptoFrame(EncryptionLevel level,
26 QuicStreamOffset offset,
27 const char* data_buffer,
28 QuicPacketLength data_length)
29 : level(level),
30 data_length(data_length),
31 data_buffer(data_buffer),
32 offset(offset) {}
33
34QuicCryptoFrame::~QuicCryptoFrame() {}
35
36std::ostream& operator<<(std::ostream& os,
37 const QuicCryptoFrame& stream_frame) {
renjietang15dfaa82020-01-03 16:13:38 -080038 os << "{ level: " << static_cast<int>(stream_frame.level)
39 << ", offset: " << stream_frame.offset
QUICHE teama6ef0a62019-03-07 20:34:33 -050040 << ", length: " << stream_frame.data_length << " }\n";
41 return os;
42}
43
44} // namespace quic