| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2016 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/quic/quic_header_list.h" | |
| 6 | |
| 7 using std::string; | |
| 8 | |
| 9 namespace net { | |
| 10 | |
| 11 QuicHeaderList::QuicHeaderList() : uncompressed_header_bytes_(0) {} | |
| 12 | |
| 13 QuicHeaderList::QuicHeaderList(QuicHeaderList&& other) = default; | |
| 14 | |
| 15 QuicHeaderList::QuicHeaderList(const QuicHeaderList& other) = default; | |
| 16 | |
| 17 QuicHeaderList& QuicHeaderList::operator=(const QuicHeaderList& other) = | |
| 18 default; | |
| 19 | |
| 20 QuicHeaderList& QuicHeaderList::operator=(QuicHeaderList&& other) = default; | |
| 21 | |
| 22 QuicHeaderList::~QuicHeaderList() {} | |
| 23 | |
| 24 void QuicHeaderList::OnHeaderBlockStart() { | |
| 25 QUIC_BUG_IF(uncompressed_header_bytes_ != 0) | |
| 26 << "OnHeaderBlockStart called more than once!"; | |
| 27 } | |
| 28 | |
| 29 void QuicHeaderList::OnHeader(base::StringPiece name, base::StringPiece value) { | |
| 30 header_list_.emplace_back(name.as_string(), value.as_string()); | |
| 31 } | |
| 32 | |
| 33 void QuicHeaderList::OnHeaderBlockEnd(size_t uncompressed_header_bytes) { | |
| 34 uncompressed_header_bytes_ = uncompressed_header_bytes; | |
| 35 } | |
| 36 | |
| 37 void QuicHeaderList::Clear() { | |
| 38 header_list_.clear(); | |
| 39 uncompressed_header_bytes_ = 0; | |
| 40 } | |
| 41 | |
| 42 string QuicHeaderList::DebugString() const { | |
| 43 string s = "{ "; | |
| 44 for (const auto& p : *this) { | |
| 45 s.append(p.first + "=" + p.second + ", "); | |
| 46 } | |
| 47 s.append("}"); | |
| 48 return s; | |
| 49 } | |
| 50 | |
| 51 } // namespace net | |
| OLD | NEW |