Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: net/quic/core/quic_client_session_base.h

Issue 2446893003: Make Quic client more memory efficient. Protected by --quic_headers_stream_release_sequencer_buffer. (Closed)
Patch Set: Remove NOLINT Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 virtual void DeletePromised(QuicClientPromisedInfo* promised); 104 virtual void DeletePromised(QuicClientPromisedInfo* promised);
105 105
106 virtual void OnPushStreamTimedOut(QuicStreamId stream_id); 106 virtual void OnPushStreamTimedOut(QuicStreamId stream_id);
107 107
108 // Sends Rst for the stream, and makes sure that future calls to 108 // Sends Rst for the stream, and makes sure that future calls to
109 // IsClosedStream(id) return true, which ensures that any subsequent 109 // IsClosedStream(id) return true, which ensures that any subsequent
110 // frames related to this stream will be ignored (modulo flow 110 // frames related to this stream will be ignored (modulo flow
111 // control accounting). 111 // control accounting).
112 void ResetPromised(QuicStreamId id, QuicRstStreamErrorCode error_code); 112 void ResetPromised(QuicStreamId id, QuicRstStreamErrorCode error_code);
113 113
114 // Release headers stream's sequencer buffer if it's empty.
115 void CloseStreamInner(QuicStreamId stream_id, bool locally_reset) override;
116
117 // Returns true if there are no active requests and no promised streams.
118 bool ShouldReleaseHeadersStreamSequencerBuffer() override;
119
114 size_t get_max_promises() const { 120 size_t get_max_promises() const {
115 return max_open_incoming_streams() * kMaxPromisedStreamsMultiplier; 121 return max_open_incoming_streams() * kMaxPromisedStreamsMultiplier;
116 } 122 }
117 123
118 QuicClientPushPromiseIndex* push_promise_index() { 124 QuicClientPushPromiseIndex* push_promise_index() {
119 return push_promise_index_; 125 return push_promise_index_;
120 } 126 }
121 127
122 private: 128 private:
123 // For QuicSpdyClientStream to detect that a response corresponds to a 129 // For QuicSpdyClientStream to detect that a response corresponds to a
124 // promise. 130 // promise.
125 using QuicPromisedByIdMap = 131 using QuicPromisedByIdMap =
126 std::unordered_map<QuicStreamId, std::unique_ptr<QuicClientPromisedInfo>>; 132 std::unordered_map<QuicStreamId, std::unique_ptr<QuicClientPromisedInfo>>;
127 133
128 // As per rfc7540, section 10.5: track promise streams in "reserved 134 // As per rfc7540, section 10.5: track promise streams in "reserved
129 // (remote)". The primary key is URL from he promise request 135 // (remote)". The primary key is URL from he promise request
130 // headers. The promised stream id is a secondary key used to get 136 // headers. The promised stream id is a secondary key used to get
131 // promise info when the response headers of the promised stream 137 // promise info when the response headers of the promised stream
132 // arrive. 138 // arrive.
133 QuicClientPushPromiseIndex* push_promise_index_; 139 QuicClientPushPromiseIndex* push_promise_index_;
134 QuicPromisedByIdMap promised_by_id_; 140 QuicPromisedByIdMap promised_by_id_;
135 QuicStreamId largest_promised_stream_id_; 141 QuicStreamId largest_promised_stream_id_;
136 142
137 DISALLOW_COPY_AND_ASSIGN(QuicClientSessionBase); 143 DISALLOW_COPY_AND_ASSIGN(QuicClientSessionBase);
138 }; 144 };
139 145
140 } // namespace net 146 } // namespace net
141 147
142 #endif // NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_ 148 #endif // NET_QUIC_QUIC_CLIENT_SESSION_BASE_H_
OLDNEW
« no previous file with comments | « no previous file | net/quic/core/quic_client_session_base.cc » ('j') | net/quic/core/quic_flags_list.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698