OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_SPDY_SPDY_HEADERS_BLOCK_PARSER_H_ | 5 #ifndef NET_SPDY_SPDY_HEADERS_BLOCK_PARSER_H_ |
6 #define NET_SPDY_SPDY_HEADERS_BLOCK_PARSER_H_ | 6 #define NET_SPDY_SPDY_HEADERS_BLOCK_PARSER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/strings/string_piece.h" | 14 #include "base/strings/string_piece.h" |
15 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
16 #include "net/spdy/spdy_headers_handler_interface.h" | 16 #include "net/spdy/spdy_headers_handler_interface.h" |
17 #include "net/spdy/spdy_prefixed_buffer_reader.h" | 17 #include "net/spdy/spdy_prefixed_buffer_reader.h" |
18 #include "net/spdy/spdy_protocol.h" | 18 #include "net/spdy/spdy_protocol.h" |
19 | 19 |
20 namespace net { | 20 namespace net { |
21 | 21 |
22 namespace test { | |
23 | |
24 class SpdyHeadersBlockParserPeer; | |
25 | |
26 } // namespace test | |
27 | |
28 // This class handles SPDY headers block bytes and parses out key-value pairs | 22 // This class handles SPDY headers block bytes and parses out key-value pairs |
29 // as they arrive. This class is not thread-safe, and assumes that all headers | 23 // as they arrive. This class is not thread-safe, and assumes that all headers |
30 // block bytes are processed in a single thread. | 24 // block bytes are processed in a single thread. |
31 class NET_EXPORT_PRIVATE SpdyHeadersBlockParser { | 25 class NET_EXPORT_PRIVATE SpdyHeadersBlockParser { |
32 public: | 26 public: |
33 // Bound on acceptable header name or value length. | 27 // Bound on acceptable header name or value length. |
34 static const size_t kMaximumFieldLength; // = 16 * 1024 | 28 static const size_t kMaximumFieldLength; // = 16 * 1024 |
35 | 29 |
36 // Constructor. The handler's OnHeader will be called for every key | 30 // Constructor. The handler's OnHeader will be called for every key |
37 // value pair that we parsed from the headers block. | 31 // value pair that we parsed from the headers block. |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 SpdyStreamId stream_id_; | 113 SpdyStreamId stream_id_; |
120 | 114 |
121 ParserError error_; | 115 ParserError error_; |
122 | 116 |
123 const SpdyMajorVersion spdy_version_; | 117 const SpdyMajorVersion spdy_version_; |
124 }; | 118 }; |
125 | 119 |
126 } // namespace net | 120 } // namespace net |
127 | 121 |
128 #endif // NET_SPDY_SPDY_HEADERS_BLOCK_PARSER_H_ | 122 #endif // NET_SPDY_SPDY_HEADERS_BLOCK_PARSER_H_ |
OLD | NEW |