• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 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/spdy/core/hpack/hpack_entry.h"
6 
7 #include "absl/strings/str_cat.h"
8 
9 namespace spdy {
10 
HpackEntry(std::string name,std::string value)11 HpackEntry::HpackEntry(std::string name, std::string value)
12     : name_(std::move(name)), value_(std::move(value)) {}
13 
14 // static
Size(absl::string_view name,absl::string_view value)15 size_t HpackEntry::Size(absl::string_view name, absl::string_view value) {
16   return name.size() + value.size() + kHpackEntrySizeOverhead;
17 }
Size() const18 size_t HpackEntry::Size() const { return Size(name(), value()); }
19 
GetDebugString() const20 std::string HpackEntry::GetDebugString() const {
21   return absl::StrCat("{ name: \"", name_, "\", value: \"", value_, "\" }");
22 }
23 
24 }  // namespace spdy
25