QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 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 "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" |
| 8 | |
| 9 | namespace quic { |
| 10 | |
| 11 | QuicCryptoFrame::QuicCryptoFrame() |
QUICHE team | 6987b4a | 2019-03-15 16:23:04 -0700 | [diff] [blame] | 12 | : QuicCryptoFrame(ENCRYPTION_INITIAL, 0, nullptr, 0) {} |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 13 | |
| 14 | QuicCryptoFrame::QuicCryptoFrame(EncryptionLevel level, |
| 15 | QuicStreamOffset offset, |
| 16 | QuicPacketLength data_length) |
| 17 | : QuicCryptoFrame(level, offset, nullptr, data_length) {} |
| 18 | |
| 19 | QuicCryptoFrame::QuicCryptoFrame(EncryptionLevel level, |
| 20 | QuicStreamOffset offset, |
| 21 | QuicStringPiece data) |
| 22 | : QuicCryptoFrame(level, offset, data.data(), data.length()) {} |
| 23 | |
| 24 | QuicCryptoFrame::QuicCryptoFrame(EncryptionLevel level, |
| 25 | QuicStreamOffset offset, |
| 26 | const char* data_buffer, |
| 27 | QuicPacketLength data_length) |
| 28 | : level(level), |
| 29 | data_length(data_length), |
| 30 | data_buffer(data_buffer), |
| 31 | offset(offset) {} |
| 32 | |
| 33 | QuicCryptoFrame::~QuicCryptoFrame() {} |
| 34 | |
| 35 | std::ostream& operator<<(std::ostream& os, |
| 36 | const QuicCryptoFrame& stream_frame) { |
| 37 | os << "{ offset: " << stream_frame.offset |
| 38 | << ", length: " << stream_frame.data_length << " }\n"; |
| 39 | return os; |
| 40 | } |
| 41 | |
| 42 | } // namespace quic |