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 #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 "absl/strings/string_view.h" 12 #include "quiche/quic/core/quic_constants.h" 13 #include "quiche/quic/core/quic_types.h" 14 #include "quiche/quic/platform/api/quic_export.h" 15 16 namespace quic { 17 18 struct QUICHE_EXPORT QuicNewTokenFrame { 19 QuicNewTokenFrame() = default; 20 QuicNewTokenFrame(QuicControlFrameId control_frame_id, 21 absl::string_view token); 22 23 friend QUICHE_EXPORT std::ostream& operator<<(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. 28 QuicControlFrameId control_frame_id = kInvalidControlFrameId; 29 30 std::string token; 31 }; 32 static_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_ 38