| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/quic/core/quic_header_list.h" | 5 #include "net/quic/core/quic_header_list.h" |
| 6 | 6 |
| 7 using std::string; | 7 using std::string; |
| 8 | 8 |
| 9 namespace net { | 9 namespace net { |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 QUIC_BUG_IF(uncompressed_header_bytes_ != 0) | 25 QUIC_BUG_IF(uncompressed_header_bytes_ != 0) |
| 26 << "OnHeaderBlockStart called more than once!"; | 26 << "OnHeaderBlockStart called more than once!"; |
| 27 } | 27 } |
| 28 | 28 |
| 29 void QuicHeaderList::OnHeader(base::StringPiece name, base::StringPiece value) { | 29 void QuicHeaderList::OnHeader(base::StringPiece name, base::StringPiece value) { |
| 30 header_list_.emplace_back(name.as_string(), value.as_string()); | 30 header_list_.emplace_back(name.as_string(), value.as_string()); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void QuicHeaderList::OnHeaderBlockEnd(size_t uncompressed_header_bytes) { | 33 void QuicHeaderList::OnHeaderBlockEnd(size_t uncompressed_header_bytes) { |
| 34 uncompressed_header_bytes_ = uncompressed_header_bytes; | 34 uncompressed_header_bytes_ = uncompressed_header_bytes; |
| 35 compressed_header_bytes_ = uncompressed_header_bytes; |
| 36 } |
| 37 |
| 38 void QuicHeaderList::OnHeaderBlockEnd(size_t uncompressed_header_bytes, |
| 39 size_t compressed_header_bytes) { |
| 40 uncompressed_header_bytes_ = uncompressed_header_bytes; |
| 41 compressed_header_bytes_ = compressed_header_bytes; |
| 35 } | 42 } |
| 36 | 43 |
| 37 void QuicHeaderList::Clear() { | 44 void QuicHeaderList::Clear() { |
| 38 header_list_.clear(); | 45 header_list_.clear(); |
| 39 uncompressed_header_bytes_ = 0; | 46 uncompressed_header_bytes_ = 0; |
| 40 } | 47 } |
| 41 | 48 |
| 42 string QuicHeaderList::DebugString() const { | 49 string QuicHeaderList::DebugString() const { |
| 43 string s = "{ "; | 50 string s = "{ "; |
| 44 for (const auto& p : *this) { | 51 for (const auto& p : *this) { |
| 45 s.append(p.first + "=" + p.second + ", "); | 52 s.append(p.first + "=" + p.second + ", "); |
| 46 } | 53 } |
| 47 s.append("}"); | 54 s.append("}"); |
| 48 return s; | 55 return s; |
| 49 } | 56 } |
| 50 | 57 |
| 51 } // namespace net | 58 } // namespace net |
| OLD | NEW |