| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CLIENT_SESSION_BASE_H_ | 5 #ifndef NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ |
| 6 #define NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ | 6 #define NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "net/quic/quic_crypto_client_stream.h" | 9 #include "net/quic/quic_crypto_client_stream.h" |
| 10 #include "net/quic/quic_spdy_session.h" | 10 #include "net/quic/quic_spdy_session.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // Sends Rst for the stream, and makes sure that future calls to | 91 // Sends Rst for the stream, and makes sure that future calls to |
| 92 // IsClosedStream(id) return true, which ensures that any subsequent | 92 // IsClosedStream(id) return true, which ensures that any subsequent |
| 93 // frames related to this stream will be ignored (modulo flow | 93 // frames related to this stream will be ignored (modulo flow |
| 94 // control accounting). | 94 // control accounting). |
| 95 void ResetPromised(QuicStreamId id, QuicRstStreamErrorCode error_code); | 95 void ResetPromised(QuicStreamId id, QuicRstStreamErrorCode error_code); |
| 96 | 96 |
| 97 size_t get_max_promises() const { | 97 size_t get_max_promises() const { |
| 98 return max_open_incoming_streams() * kMaxPromisedStreamsMultiplier; | 98 return max_open_incoming_streams() * kMaxPromisedStreamsMultiplier; |
| 99 } | 99 } |
| 100 | 100 |
| 101 QuicClientPushPromiseIndex* push_promise_index() { |
| 102 return push_promise_index_; |
| 103 } |
| 104 |
| 101 private: | 105 private: |
| 102 // For QuicSpdyClientStream to detect that a response corresponds to a | 106 // For QuicSpdyClientStream to detect that a response corresponds to a |
| 103 // promise. | 107 // promise. |
| 104 using QuicPromisedByIdMap = | 108 using QuicPromisedByIdMap = |
| 105 std::unordered_map<QuicStreamId, std::unique_ptr<QuicClientPromisedInfo>>; | 109 std::unordered_map<QuicStreamId, std::unique_ptr<QuicClientPromisedInfo>>; |
| 106 | 110 |
| 107 // As per rfc7540, section 10.5: track promise streams in "reserved | 111 // As per rfc7540, section 10.5: track promise streams in "reserved |
| 108 // (remote)". The primary key is URL from he promise request | 112 // (remote)". The primary key is URL from he promise request |
| 109 // headers. The promised stream id is a secondary key used to get | 113 // headers. The promised stream id is a secondary key used to get |
| 110 // promise info when the response headers of the promised stream | 114 // promise info when the response headers of the promised stream |
| 111 // arrive. | 115 // arrive. |
| 112 QuicClientPushPromiseIndex* push_promise_index_; | 116 QuicClientPushPromiseIndex* push_promise_index_; |
| 113 QuicPromisedByIdMap promised_by_id_; | 117 QuicPromisedByIdMap promised_by_id_; |
| 114 QuicStreamId largest_promised_stream_id_; | 118 QuicStreamId largest_promised_stream_id_; |
| 115 | 119 |
| 116 DISALLOW_COPY_AND_ASSIGN(QuicClientSessionBase); | 120 DISALLOW_COPY_AND_ASSIGN(QuicClientSessionBase); |
| 117 }; | 121 }; |
| 118 | 122 |
| 119 } // namespace net | 123 } // namespace net |
| 120 | 124 |
| 121 #endif // NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ | 125 #endif // NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ |
| OLD | NEW |