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 #ifndef NET_QUIC_QUIC_HEADER_LIST_H_ | |
ramant (doing other things)
2016/04/11 18:11:57
Please add a blank line between line#3 and line#4
Zhongyi Shi
2016/04/11 18:27:31
Done in the Final CL.
| |
5 #define NET_QUIC_QUIC_HEADER_LIST_H_ | |
6 | |
7 #include <deque> | |
8 #include <functional> | |
9 | |
10 #include "base/strings/string_piece.h" | |
11 #include "net/base/net_export.h" | |
12 #include "net/quic/quic_bug_tracker.h" | |
13 #include "net/spdy/spdy_header_block.h" | |
14 #include "net/spdy/spdy_headers_handler_interface.h" | |
15 | |
16 namespace net { | |
17 | |
18 // A simple class that accumulates header pairs | |
19 class NET_EXPORT_PRIVATE QuicHeaderList : public SpdyHeadersHandlerInterface { | |
20 public: | |
21 typedef std::deque<std::pair<std::string, std::string>> ListType; | |
22 | |
23 QuicHeaderList(); | |
24 QuicHeaderList(QuicHeaderList&& other); | |
25 QuicHeaderList(const QuicHeaderList& other); | |
26 QuicHeaderList& operator=(QuicHeaderList&& other); | |
27 QuicHeaderList& operator=(const QuicHeaderList& other); | |
28 ~QuicHeaderList() override; | |
29 | |
30 // From SpdyHeadersHandlerInteface. | |
31 void OnHeaderBlockStart() override; | |
32 void OnHeader(base::StringPiece name, base::StringPiece value) override; | |
33 void OnHeaderBlockEnd(size_t uncompressed_header_bytes) override; | |
34 | |
35 void Clear(); | |
36 | |
37 ListType::const_iterator begin() const { return header_list_.begin(); } | |
38 ListType::const_iterator end() const { return header_list_.end(); } | |
39 | |
40 bool empty() const { return header_list_.empty(); } | |
41 size_t uncompressed_header_bytes() const { | |
42 return uncompressed_header_bytes_; | |
43 } | |
44 | |
45 private: | |
46 std::deque<std::pair<std::string, std::string>> header_list_; | |
47 size_t uncompressed_header_bytes_; | |
48 }; | |
49 | |
50 } // namespace net | |
51 | |
52 #endif // NET_QUIC_QUIC_HEADER_LIST_H_ | |
OLD | NEW |