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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
11 #include "net/quic/quic_protocol.h" | 11 #include "net/quic/quic_protocol.h" |
12 #include "net/quic/quic_spdy_decompressor.h" | 12 #include "net/quic/quic_spdy_decompressor.h" |
13 #include "net/quic/reliable_quic_stream.h" | 13 #include "net/quic/reliable_quic_stream.h" |
14 #include "net/spdy/spdy_framer.h" | 14 #include "net/spdy/spdy_framer.h" |
15 | 15 |
16 namespace net { | 16 namespace net { |
17 | 17 |
18 // Headers in QUIC are sent as SPDY SYN_STREAM or SYN_REPLY frames | 18 // Headers in QUIC are sent as SPDY SYN_STREAM or SYN_REPLY frames |
19 // over a reserved reliable stream with the id 2. Each endpoint (client | 19 // over a reserved reliable stream with the id 2. Each endpoint (client |
20 // and server) will allocate an instance of QuicHeadersStream to send | 20 // and server) will allocate an instance of QuicHeadersStream to send |
21 // and receive headers. | 21 // and receive headers. |
22 class NET_EXPORT_PRIVATE QuicHeadersStream : public ReliableQuicStream { | 22 class NET_EXPORT_PRIVATE QuicHeadersStream : public ReliableQuicStream { |
23 public: | 23 public: |
24 explicit QuicHeadersStream(QuicSession* session); | 24 explicit QuicHeadersStream(QuicSession* session); |
25 virtual ~QuicHeadersStream(); | 25 virtual ~QuicHeadersStream() OVERRIDE; |
26 | 26 |
27 // Writes |headers| for |stream_id| in a SYN_STREAM or SYN_REPLY | 27 // Writes |headers| for |stream_id| in a SYN_STREAM or SYN_REPLY |
28 // frame to the peer. If |fin| is true, the fin flag will be set on | 28 // frame to the peer. If |fin| is true, the fin flag will be set on |
29 // the SPDY frame. Returns the size, in bytes, of the resulting | 29 // the SPDY frame. Returns the size, in bytes, of the resulting |
30 // SPDY frame. | 30 // SPDY frame. |
31 size_t WriteHeaders(QuicStreamId stream_id, | 31 size_t WriteHeaders(QuicStreamId stream_id, |
32 const SpdyHeaderBlock& headers, | 32 const SpdyHeaderBlock& headers, |
33 bool fin); | 33 bool fin); |
34 | 34 |
35 // ReliableQuicStream implementation | 35 // ReliableQuicStream implementation |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 SpdyFramer spdy_framer_; | 73 SpdyFramer spdy_framer_; |
74 scoped_ptr<SpdyFramerVisitor> spdy_framer_visitor_; | 74 scoped_ptr<SpdyFramerVisitor> spdy_framer_visitor_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(QuicHeadersStream); | 76 DISALLOW_COPY_AND_ASSIGN(QuicHeadersStream); |
77 }; | 77 }; |
78 | 78 |
79 } // namespace net | 79 } // namespace net |
80 | 80 |
81 #endif // NET_QUIC_QUIC_HEADERS_STREAM_H_ | 81 #endif // NET_QUIC_QUIC_HEADERS_STREAM_H_ |
OLD | NEW |