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

Side by Side Diff: net/quic/quic_session.h

Issue 23587004: If the stream is being closed locally (for example in the case of a (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 7 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // A QuicSession, which demuxes a single connection to individual streams. 5 // A QuicSession, which demuxes a single connection to individual streams.
6 6
7 #ifndef NET_QUIC_QUIC_SESSION_H_ 7 #ifndef NET_QUIC_QUIC_SESSION_H_
8 #define NET_QUIC_QUIC_SESSION_H_ 8 #define NET_QUIC_QUIC_SESSION_H_
9 9
10 #include <vector> 10 #include <vector>
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 size_t get_max_open_streams() const { 204 size_t get_max_open_streams() const {
205 return max_open_streams_; 205 return max_open_streams_;
206 } 206 }
207 207
208 private: 208 private:
209 friend class test::QuicSessionPeer; 209 friend class test::QuicSessionPeer;
210 friend class VisitorShim; 210 friend class VisitorShim;
211 211
212 typedef base::hash_map<QuicStreamId, ReliableQuicStream*> ReliableStreamMap; 212 typedef base::hash_map<QuicStreamId, ReliableQuicStream*> ReliableStreamMap;
213 213
214 // Performs the work required to close |stream_id|. If |locally_reset|
215 // then the stream has been reset by this endpoint, not by the peer. This
216 // means the stream may become a zombie stream which needs to stay
217 // around until headers have been decompressed.
218 void CloseStreamInner(QuicStreamId stream_id, bool locally_reset);
219
220 // Adds |stream_id| to the zobmie stream map, closing the oldest
221 // zombie stream if the set is full.
222 void AddZombieStream(QuicStreamId stream_id);
223
224 // Closes the zombie stream |stream_id| and removes it from the zombie
225 // stream map.
226 void CloseZombieStream(QuicStreamId stream_id);
227
228 // Adds |stream_id| to the prematurely closed stream map, removing the
229 // oldest prematurely closed stream if the set is full.
230 void AddPrematurelyClosedStream(QuicStreamId stream_id);
231
214 scoped_ptr<QuicConnection> connection_; 232 scoped_ptr<QuicConnection> connection_;
215 233
216 // Tracks the last 20 streams which closed without decompressing headers. 234 // Tracks the last 20 streams which closed without decompressing headers.
217 // This is for best-effort detection of an unrecoverable compression context. 235 // This is for best-effort detection of an unrecoverable compression context.
218 // Ideally this would be a linked_hash_set as the boolean is unused. 236 // Ideally this would be a linked_hash_set as the boolean is unused.
219 linked_hash_map<QuicStreamId, bool> prematurely_closed_streams_; 237 linked_hash_map<QuicStreamId, bool> prematurely_closed_streams_;
220 238
239 // Streams which have been locally reset before decompressing headers
240 // from the peer. These streams need to stay open long enough to
241 // process any headers from the peer.
242 // Ideally this would be a linked_hash_set as the boolean is unused.
243 linked_hash_map<QuicStreamId, bool> zombie_streams_;
244
221 // A shim to stand between the connection and the session, to handle stream 245 // A shim to stand between the connection and the session, to handle stream
222 // deletions. 246 // deletions.
223 scoped_ptr<VisitorShim> visitor_shim_; 247 scoped_ptr<VisitorShim> visitor_shim_;
224 248
225 std::vector<ReliableQuicStream*> closed_streams_; 249 std::vector<ReliableQuicStream*> closed_streams_;
226 250
227 QuicSpdyDecompressor decompressor_; 251 QuicSpdyDecompressor decompressor_;
228 QuicSpdyCompressor compressor_; 252 QuicSpdyCompressor compressor_;
229 253
230 QuicConfig config_; 254 QuicConfig config_;
(...skipping 26 matching lines...) Expand all
257 bool goaway_received_; 281 bool goaway_received_;
258 // Whether a GoAway has been sent. 282 // Whether a GoAway has been sent.
259 bool goaway_sent_; 283 bool goaway_sent_;
260 284
261 DISALLOW_COPY_AND_ASSIGN(QuicSession); 285 DISALLOW_COPY_AND_ASSIGN(QuicSession);
262 }; 286 };
263 287
264 } // namespace net 288 } // namespace net
265 289
266 #endif // NET_QUIC_QUIC_SESSION_H_ 290 #endif // NET_QUIC_QUIC_SESSION_H_
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698