blob: abb0eecb2fb8da45fde50011d0c4df95f6ad0f76 [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#ifndef QUICHE_QUIC_CORE_FRAMES_QUIC_NEW_TOKEN_FRAME_H_
6#define QUICHE_QUIC_CORE_FRAMES_QUIC_NEW_TOKEN_FRAME_H_
7
8#include <memory>
9#include <ostream>
10
11#include "net/third_party/quiche/src/quic/core/quic_buffer_allocator.h"
wubbddcc502020-04-21 07:10:57 -070012#include "net/third_party/quiche/src/quic/core/quic_constants.h"
QUICHE teama6ef0a62019-03-07 20:34:33 -050013#include "net/third_party/quiche/src/quic/core/quic_types.h"
14#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
QUICHE teama6ef0a62019-03-07 20:34:33 -050015
16namespace quic {
17
18struct QUIC_EXPORT_PRIVATE QuicNewTokenFrame {
wubbddcc502020-04-21 07:10:57 -070019 QuicNewTokenFrame() = default;
vasilvvc48c8712019-03-11 13:38:16 -070020 QuicNewTokenFrame(QuicControlFrameId control_frame_id, std::string token);
QUICHE teama6ef0a62019-03-07 20:34:33 -050021
22 friend QUIC_EXPORT_PRIVATE std::ostream& operator<<(
23 std::ostream& os,
24 const QuicNewTokenFrame& s);
25
26 // A unique identifier of this control frame. 0 when this frame is received,
27 // and non-zero when sent.
wubbddcc502020-04-21 07:10:57 -070028 QuicControlFrameId control_frame_id = kInvalidControlFrameId;
QUICHE teama6ef0a62019-03-07 20:34:33 -050029
vasilvvc48c8712019-03-11 13:38:16 -070030 std::string token;
QUICHE teama6ef0a62019-03-07 20:34:33 -050031};
32static_assert(sizeof(QuicNewTokenFrame) <= 64,
33 "Keep the QuicNewTokenFrame size to a cacheline.");
34
35} // namespace quic
36
37#endif // QUICHE_QUIC_CORE_FRAMES_QUIC_NEW_TOKEN_FRAME_H_