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" |
(...skipping 13 matching lines...) Expand all Loading... |
24 ~QuicHeadersStream() override; | 24 ~QuicHeadersStream() override; |
25 | 25 |
26 // Writes |headers| for |stream_id| in a SYN_STREAM or SYN_REPLY | 26 // Writes |headers| for |stream_id| in a SYN_STREAM or SYN_REPLY |
27 // frame to the peer. If |fin| is true, the fin flag will be set on | 27 // frame to the peer. If |fin| is true, the fin flag will be set on |
28 // the SPDY frame. Returns the size, in bytes, of the resulting | 28 // the SPDY frame. Returns the size, in bytes, of the resulting |
29 // SPDY frame. | 29 // SPDY frame. |
30 size_t WriteHeaders( | 30 size_t WriteHeaders( |
31 QuicStreamId stream_id, | 31 QuicStreamId stream_id, |
32 const SpdyHeaderBlock& headers, | 32 const SpdyHeaderBlock& headers, |
33 bool fin, | 33 bool fin, |
| 34 QuicPriority priority, |
34 QuicAckNotifier::DelegateInterface* ack_notifier_delegate); | 35 QuicAckNotifier::DelegateInterface* ack_notifier_delegate); |
35 | 36 |
36 // ReliableQuicStream implementation | 37 // ReliableQuicStream implementation |
37 uint32 ProcessRawData(const char* data, uint32 data_len) override; | 38 uint32 ProcessRawData(const char* data, uint32 data_len) override; |
38 QuicPriority EffectivePriority() const override; | 39 QuicPriority EffectivePriority() const override; |
39 | 40 |
| 41 void OnSuccessfulVersionNegotiation(QuicVersion version); |
| 42 |
40 private: | 43 private: |
41 class SpdyFramerVisitor; | 44 class SpdyFramerVisitor; |
42 | 45 |
| 46 void InitializeFramer(QuicVersion version); |
| 47 |
43 // The following methods are called by the SimpleVisitor. | 48 // The following methods are called by the SimpleVisitor. |
44 | 49 |
45 // Called when a SYN_STREAM frame has been received. | 50 // Called when a SYN_STREAM frame has been received. |
46 void OnSynStream(SpdyStreamId stream_id, | 51 void OnSynStream(SpdyStreamId stream_id, |
47 SpdyPriority priority, | 52 SpdyPriority priority, |
48 bool fin); | 53 bool fin); |
49 | 54 |
50 // Called when a SYN_REPLY frame been received. | 55 // Called when a SYN_REPLY frame been received. |
51 void OnSynReply(SpdyStreamId stream_id, bool fin); | 56 void OnSynReply(SpdyStreamId stream_id, bool fin); |
52 | 57 |
(...skipping 11 matching lines...) Expand all Loading... |
64 void OnCompressedFrameSize(size_t frame_len); | 69 void OnCompressedFrameSize(size_t frame_len); |
65 | 70 |
66 // Returns true if the session is still connected. | 71 // Returns true if the session is still connected. |
67 bool IsConnected(); | 72 bool IsConnected(); |
68 | 73 |
69 // Data about the stream whose headers are being processed. | 74 // Data about the stream whose headers are being processed. |
70 QuicStreamId stream_id_; | 75 QuicStreamId stream_id_; |
71 bool fin_; | 76 bool fin_; |
72 size_t frame_len_; | 77 size_t frame_len_; |
73 | 78 |
74 SpdyFramer spdy_framer_; | 79 scoped_ptr<SpdyFramer> spdy_framer_; |
75 scoped_ptr<SpdyFramerVisitor> spdy_framer_visitor_; | 80 scoped_ptr<SpdyFramerVisitor> spdy_framer_visitor_; |
76 | 81 |
77 DISALLOW_COPY_AND_ASSIGN(QuicHeadersStream); | 82 DISALLOW_COPY_AND_ASSIGN(QuicHeadersStream); |
78 }; | 83 }; |
79 | 84 |
80 } // namespace net | 85 } // namespace net |
81 | 86 |
82 #endif // NET_QUIC_QUIC_HEADERS_STREAM_H_ | 87 #endif // NET_QUIC_QUIC_HEADERS_STREAM_H_ |
OLD | NEW |