• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2021 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 "quiche/quic/core/http/http_constants.h"
6 
7 #include "absl/strings/str_cat.h"
8 
9 namespace quic {
10 
11 #define RETURN_STRING_LITERAL(x) \
12   case x:                        \
13     return #x;
14 
H3SettingsToString(Http3AndQpackSettingsIdentifiers identifier)15 std::string H3SettingsToString(Http3AndQpackSettingsIdentifiers identifier) {
16   switch (identifier) {
17     RETURN_STRING_LITERAL(SETTINGS_QPACK_MAX_TABLE_CAPACITY);
18     RETURN_STRING_LITERAL(SETTINGS_MAX_FIELD_SECTION_SIZE);
19     RETURN_STRING_LITERAL(SETTINGS_QPACK_BLOCKED_STREAMS);
20     RETURN_STRING_LITERAL(SETTINGS_H3_DATAGRAM_DRAFT04);
21     RETURN_STRING_LITERAL(SETTINGS_H3_DATAGRAM);
22     RETURN_STRING_LITERAL(SETTINGS_WEBTRANS_DRAFT00);
23     RETURN_STRING_LITERAL(SETTINGS_ENABLE_CONNECT_PROTOCOL);
24     RETURN_STRING_LITERAL(SETTINGS_ENABLE_METADATA);
25   }
26   return absl::StrCat("UNSUPPORTED_SETTINGS_TYPE(", identifier, ")");
27 }
28 
29 ABSL_CONST_INIT const absl::string_view kUserAgentHeaderName = "user-agent";
30 
31 #undef RETURN_STRING_LITERAL  // undef for jumbo builds
32 
33 }  // namespace quic
34