OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_HEADERS_STREAM_H_ | 5 #ifndef NET_QUIC_QUIC_HEADERS_STREAM_H_ |
6 #define NET_QUIC_QUIC_HEADERS_STREAM_H_ | 6 #define NET_QUIC_QUIC_HEADERS_STREAM_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "net/base/net_export.h" | 13 #include "net/base/net_export.h" |
14 #include "net/quic/quic_header_list.h" | 14 #include "net/quic/quic_header_list.h" |
15 #include "net/quic/quic_protocol.h" | 15 #include "net/quic/quic_protocol.h" |
16 #include "net/quic/reliable_quic_stream.h" | 16 #include "net/quic/reliable_quic_stream.h" |
17 #include "net/spdy/spdy_framer.h" | 17 #include "net/spdy/spdy_framer.h" |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 | 20 |
21 class QuicSpdySession; | 21 class QuicSpdySession; |
22 | 22 |
| 23 namespace test { |
| 24 class QuicHeadersStreamPeer; |
| 25 } // namespace test |
| 26 |
23 // Headers in QUIC are sent as HTTP/2 HEADERS or PUSH_PROMISE frames | 27 // Headers in QUIC are sent as HTTP/2 HEADERS or PUSH_PROMISE frames |
24 // over a reserved reliable stream with the id 3. Each endpoint | 28 // over a reserved reliable stream with the id 3. Each endpoint |
25 // (client and server) will allocate an instance of QuicHeadersStream | 29 // (client and server) will allocate an instance of QuicHeadersStream |
26 // to send and receive headers. | 30 // to send and receive headers. |
27 class NET_EXPORT_PRIVATE QuicHeadersStream : public ReliableQuicStream { | 31 class NET_EXPORT_PRIVATE QuicHeadersStream : public ReliableQuicStream { |
28 public: | 32 public: |
29 class NET_EXPORT_PRIVATE HpackDebugVisitor { | 33 class NET_EXPORT_PRIVATE HpackDebugVisitor { |
30 public: | 34 public: |
31 HpackDebugVisitor(); | 35 HpackDebugVisitor(); |
32 | 36 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 72 |
69 // Experimental: force HPACK to use static table and huffman coding | 73 // Experimental: force HPACK to use static table and huffman coding |
70 // only. Part of exploring improvements related to headers stream | 74 // only. Part of exploring improvements related to headers stream |
71 // induced HOL blocking in QUIC. | 75 // induced HOL blocking in QUIC. |
72 void DisableHpackDynamicTable(); | 76 void DisableHpackDynamicTable(); |
73 | 77 |
74 // Optional, enables instrumentation related to go/quic-hpack. | 78 // Optional, enables instrumentation related to go/quic-hpack. |
75 void SetHpackEncoderDebugVisitor(std::unique_ptr<HpackDebugVisitor> visitor); | 79 void SetHpackEncoderDebugVisitor(std::unique_ptr<HpackDebugVisitor> visitor); |
76 void SetHpackDecoderDebugVisitor(std::unique_ptr<HpackDebugVisitor> visitor); | 80 void SetHpackDecoderDebugVisitor(std::unique_ptr<HpackDebugVisitor> visitor); |
77 | 81 |
| 82 // Sets the maximum size of the header compression table spdy_framer_ is |
| 83 // willing to use to decode header blocks. |
| 84 void UpdateHeaderEncoderTableSize(uint32_t value); |
| 85 |
78 // Sets how much encoded data the hpack decoder of spdy_framer_ is willing to | 86 // Sets how much encoded data the hpack decoder of spdy_framer_ is willing to |
79 // buffer. | 87 // buffer. |
80 void set_max_decode_buffer_size_bytes(size_t max_decode_buffer_size_bytes) { | 88 void set_max_decode_buffer_size_bytes(size_t max_decode_buffer_size_bytes) { |
81 spdy_framer_.set_max_decode_buffer_size_bytes(max_decode_buffer_size_bytes); | 89 spdy_framer_.set_max_decode_buffer_size_bytes(max_decode_buffer_size_bytes); |
82 } | 90 } |
83 | 91 |
84 private: | 92 private: |
| 93 friend class test::QuicHeadersStreamPeer; |
| 94 |
85 class SpdyFramerVisitor; | 95 class SpdyFramerVisitor; |
86 | 96 |
87 // The following methods are called by the SimpleVisitor. | 97 // The following methods are called by the SimpleVisitor. |
88 | 98 |
89 // Called when a HEADERS frame has been received. | 99 // Called when a HEADERS frame has been received. |
90 void OnHeaders(SpdyStreamId stream_id, | 100 void OnHeaders(SpdyStreamId stream_id, |
91 bool has_priority, | 101 bool has_priority, |
92 SpdyPriority priority, | 102 SpdyPriority priority, |
93 bool fin); | 103 bool fin); |
94 | 104 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 153 |
144 // Either empty, or contains the complete list of headers. | 154 // Either empty, or contains the complete list of headers. |
145 QuicHeaderList header_list_; | 155 QuicHeaderList header_list_; |
146 | 156 |
147 DISALLOW_COPY_AND_ASSIGN(QuicHeadersStream); | 157 DISALLOW_COPY_AND_ASSIGN(QuicHeadersStream); |
148 }; | 158 }; |
149 | 159 |
150 } // namespace net | 160 } // namespace net |
151 | 161 |
152 #endif // NET_QUIC_QUIC_HEADERS_STREAM_H_ | 162 #endif // NET_QUIC_QUIC_HEADERS_STREAM_H_ |
OLD | NEW |