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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 void OnConfigNegotiated() override; | 102 void OnConfigNegotiated() override; |
103 | 103 |
104 // Called by |headers_stream_| when |force_hol_blocking_| is true. | 104 // Called by |headers_stream_| when |force_hol_blocking_| is true. |
105 virtual void OnStreamFrameData(QuicStreamId stream_id, | 105 virtual void OnStreamFrameData(QuicStreamId stream_id, |
106 const char* data, | 106 const char* data, |
107 size_t len, | 107 size_t len, |
108 bool fin); | 108 bool fin); |
109 | 109 |
110 bool force_hol_blocking() const { return force_hol_blocking_; } | 110 bool force_hol_blocking() const { return force_hol_blocking_; } |
111 | 111 |
| 112 bool server_push_enabled() const { return server_push_enabled_; } |
| 113 |
| 114 // Called by |QuicHeadersStream::UpdateEnableServerPush()| with |
| 115 // value from SETTINGS_ENABLE_PUSH. |
| 116 void set_server_push_enabled(bool enable) { server_push_enabled_ = enable; } |
| 117 |
112 protected: | 118 protected: |
113 // Override CreateIncomingDynamicStream() and CreateOutgoingDynamicStream() | 119 // Override CreateIncomingDynamicStream() and CreateOutgoingDynamicStream() |
114 // with QuicSpdyStream return type to make sure that all data streams are | 120 // with QuicSpdyStream return type to make sure that all data streams are |
115 // QuicSpdyStreams. | 121 // QuicSpdyStreams. |
116 QuicSpdyStream* CreateIncomingDynamicStream(QuicStreamId id) override = 0; | 122 QuicSpdyStream* CreateIncomingDynamicStream(QuicStreamId id) override = 0; |
117 QuicSpdyStream* CreateOutgoingDynamicStream(SpdyPriority priority) override = | 123 QuicSpdyStream* CreateOutgoingDynamicStream(SpdyPriority priority) override = |
118 0; | 124 0; |
119 | 125 |
120 QuicSpdyStream* GetSpdyDataStream(const QuicStreamId stream_id); | 126 QuicSpdyStream* GetSpdyDataStream(const QuicStreamId stream_id); |
121 | 127 |
122 // If an incoming stream can be created, return true. | 128 // If an incoming stream can be created, return true. |
123 virtual bool ShouldCreateIncomingDynamicStream(QuicStreamId id) = 0; | 129 virtual bool ShouldCreateIncomingDynamicStream(QuicStreamId id) = 0; |
124 | 130 |
125 // If an outgoing stream can be created, return true. | 131 // If an outgoing stream can be created, return true. |
126 virtual bool ShouldCreateOutgoingDynamicStream() = 0; | 132 virtual bool ShouldCreateOutgoingDynamicStream() = 0; |
127 | 133 |
128 private: | 134 private: |
129 friend class test::QuicSpdySessionPeer; | 135 friend class test::QuicSpdySessionPeer; |
130 | 136 |
131 std::unique_ptr<QuicHeadersStream> headers_stream_; | 137 std::unique_ptr<QuicHeadersStream> headers_stream_; |
132 | 138 |
133 // If set, redirect all data through the headers stream in order to | 139 // If set, redirect all data through the headers stream in order to |
134 // simulate forced HOL blocking between streams as happens in | 140 // simulate forced HOL blocking between streams as happens in |
135 // HTTP/2 over TCP. | 141 // HTTP/2 over TCP. |
136 bool force_hol_blocking_; | 142 bool force_hol_blocking_; |
137 | 143 |
| 144 // Set during handshake. If true, resources in x-associated-content and link |
| 145 // headers will be pushed. |
| 146 bool server_push_enabled_; |
| 147 |
138 DISALLOW_COPY_AND_ASSIGN(QuicSpdySession); | 148 DISALLOW_COPY_AND_ASSIGN(QuicSpdySession); |
139 }; | 149 }; |
140 | 150 |
141 } // namespace net | 151 } // namespace net |
142 | 152 |
143 #endif // NET_QUIC_QUIC_SPDY_SESSION_H_ | 153 #endif // NET_QUIC_QUIC_SPDY_SESSION_H_ |
OLD | NEW |