OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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_SPDY_SESSION_H_ | 5 #ifndef NET_QUIC_QUIC_SPDY_SESSION_H_ |
6 #define NET_QUIC_QUIC_SPDY_SESSION_H_ | 6 #define NET_QUIC_QUIC_SPDY_SESSION_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 void RegisterStreamPriority(QuicStreamId id, SpdyPriority priority); | 93 void RegisterStreamPriority(QuicStreamId id, SpdyPriority priority); |
94 // Called by the stream on deletion to clear priority crom the write blocked | 94 // Called by the stream on deletion to clear priority crom the write blocked |
95 // list. | 95 // list. |
96 void UnregisterStreamPriority(QuicStreamId id); | 96 void UnregisterStreamPriority(QuicStreamId id); |
97 // Called by the stream on SetPriority to update priority on the write blocked | 97 // Called by the stream on SetPriority to update priority on the write blocked |
98 // list. | 98 // list. |
99 void UpdateStreamPriority(QuicStreamId id, SpdyPriority new_priority); | 99 void UpdateStreamPriority(QuicStreamId id, SpdyPriority new_priority); |
100 | 100 |
101 void OnConfigNegotiated() override; | 101 void OnConfigNegotiated() override; |
102 | 102 |
| 103 // Called by |headers_stream_| when |force_hol_blocking_| is true. |
| 104 virtual void OnStreamFrameData(QuicStreamId stream_id, |
| 105 const char* data, |
| 106 size_t len, |
| 107 bool fin); |
| 108 |
| 109 bool force_hol_blocking() const { return force_hol_blocking_; } |
| 110 |
103 protected: | 111 protected: |
104 // Override CreateIncomingDynamicStream() and CreateOutgoingDynamicStream() | 112 // Override CreateIncomingDynamicStream() and CreateOutgoingDynamicStream() |
105 // with QuicSpdyStream return type to make sure that all data streams are | 113 // with QuicSpdyStream return type to make sure that all data streams are |
106 // QuicSpdyStreams. | 114 // QuicSpdyStreams. |
107 QuicSpdyStream* CreateIncomingDynamicStream(QuicStreamId id) override = 0; | 115 QuicSpdyStream* CreateIncomingDynamicStream(QuicStreamId id) override = 0; |
108 QuicSpdyStream* CreateOutgoingDynamicStream(SpdyPriority priority) override = | 116 QuicSpdyStream* CreateOutgoingDynamicStream(SpdyPriority priority) override = |
109 0; | 117 0; |
110 | 118 |
111 QuicSpdyStream* GetSpdyDataStream(const QuicStreamId stream_id); | 119 QuicSpdyStream* GetSpdyDataStream(const QuicStreamId stream_id); |
112 | 120 |
113 // If an incoming stream can be created, return true. | 121 // If an incoming stream can be created, return true. |
114 virtual bool ShouldCreateIncomingDynamicStream(QuicStreamId id) = 0; | 122 virtual bool ShouldCreateIncomingDynamicStream(QuicStreamId id) = 0; |
115 | 123 |
116 // If an outgoing stream can be created, return true. | 124 // If an outgoing stream can be created, return true. |
117 virtual bool ShouldCreateOutgoingDynamicStream() = 0; | 125 virtual bool ShouldCreateOutgoingDynamicStream() = 0; |
118 | 126 |
119 private: | 127 private: |
120 friend class test::QuicSpdySessionPeer; | 128 friend class test::QuicSpdySessionPeer; |
121 | 129 |
122 std::unique_ptr<QuicHeadersStream> headers_stream_; | 130 std::unique_ptr<QuicHeadersStream> headers_stream_; |
123 | 131 |
| 132 // If set, redirect all data through the headers stream in order to |
| 133 // simulate forced HOL blocking between streams as happens in |
| 134 // HTTP/2 over TCP. |
| 135 bool force_hol_blocking_; |
| 136 |
124 DISALLOW_COPY_AND_ASSIGN(QuicSpdySession); | 137 DISALLOW_COPY_AND_ASSIGN(QuicSpdySession); |
125 }; | 138 }; |
126 | 139 |
127 } // namespace net | 140 } // namespace net |
128 | 141 |
129 #endif // NET_QUIC_QUIC_SPDY_SESSION_H_ | 142 #endif // NET_QUIC_QUIC_SPDY_SESSION_H_ |
OLD | NEW |