| 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 #ifndef NET_QUIC_QUIC_HEADER_LIST_H_ | 5 #ifndef NET_QUIC_QUIC_HEADER_LIST_H_ |
| 6 #define NET_QUIC_QUIC_HEADER_LIST_H_ | 6 #define NET_QUIC_QUIC_HEADER_LIST_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <functional> | 9 #include <functional> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 QuicHeaderList& operator=(QuicHeaderList&& other); | 28 QuicHeaderList& operator=(QuicHeaderList&& other); |
| 29 QuicHeaderList& operator=(const QuicHeaderList& other); | 29 QuicHeaderList& operator=(const QuicHeaderList& other); |
| 30 ~QuicHeaderList() override; | 30 ~QuicHeaderList() override; |
| 31 | 31 |
| 32 // From SpdyHeadersHandlerInteface. | 32 // From SpdyHeadersHandlerInteface. |
| 33 void OnHeaderBlockStart() override; | 33 void OnHeaderBlockStart() override; |
| 34 void OnHeader(base::StringPiece name, base::StringPiece value) override; | 34 void OnHeader(base::StringPiece name, base::StringPiece value) override; |
| 35 void OnHeaderBlockEnd(size_t uncompressed_header_bytes) override; | 35 void OnHeaderBlockEnd(size_t uncompressed_header_bytes) override; |
| 36 void OnHeaderBlockEnd(size_t uncompressed_header_bytes, | 36 void OnHeaderBlockEnd(size_t uncompressed_header_bytes, |
| 37 size_t compressed_header_bytes) override; | 37 size_t compressed_header_bytes) override; |
| 38 | |
| 39 void Clear(); | 38 void Clear(); |
| 40 | 39 |
| 41 const_iterator begin() const { return header_list_.begin(); } | 40 const_iterator begin() const { return header_list_.begin(); } |
| 42 const_iterator end() const { return header_list_.end(); } | 41 const_iterator end() const { return header_list_.end(); } |
| 43 | 42 |
| 44 bool empty() const { return header_list_.empty(); } | 43 bool empty() const { return header_list_.empty(); } |
| 45 size_t uncompressed_header_bytes() const { | 44 size_t uncompressed_header_bytes() const { |
| 46 return uncompressed_header_bytes_; | 45 return uncompressed_header_bytes_; |
| 47 } | 46 } |
| 48 | 47 |
| 49 size_t compressed_header_bytes() const { return compressed_header_bytes_; } | 48 size_t compressed_header_bytes() const { return compressed_header_bytes_; } |
| 50 | 49 |
| 50 void set_max_uncompressed_header_bytes(size_t max_uncompressed_header_bytes) { |
| 51 max_uncompressed_header_bytes_ = max_uncompressed_header_bytes; |
| 52 } |
| 53 |
| 51 std::string DebugString() const; | 54 std::string DebugString() const; |
| 52 | 55 |
| 53 private: | 56 private: |
| 54 std::deque<std::pair<std::string, std::string>> header_list_; | 57 std::deque<std::pair<std::string, std::string>> header_list_; |
| 58 size_t max_uncompressed_header_bytes_; |
| 55 size_t uncompressed_header_bytes_; | 59 size_t uncompressed_header_bytes_; |
| 56 size_t compressed_header_bytes_; | 60 size_t compressed_header_bytes_; |
| 57 }; | 61 }; |
| 58 | 62 |
| 59 } // namespace net | 63 } // namespace net |
| 60 | 64 |
| 61 #endif // NET_QUIC_QUIC_HEADER_LIST_H_ | 65 #endif // NET_QUIC_QUIC_HEADER_LIST_H_ |
| OLD | NEW |