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

Unified Diff: net/spdy/spdy_write_queue.cc

Issue 14232014: Correctly handle SPDY GOAWAY frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comments Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_write_queue.h ('k') | net/spdy/spdy_write_queue_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_write_queue.cc
diff --git a/net/spdy/spdy_write_queue.cc b/net/spdy/spdy_write_queue.cc
index 18ddc39bf8ec28bef9e37e31025b39e5c9d46d07..e3691e20320d27ba0755d5c34b77c4112d3fd058 100644
--- a/net/spdy/spdy_write_queue.cc
+++ b/net/spdy/spdy_write_queue.cc
@@ -89,6 +89,26 @@ void SpdyWriteQueue::RemovePendingWritesForStream(
queue->erase(out_it, queue->end());
}
+void SpdyWriteQueue::RemovePendingWritesForStreamsAfter(
+ SpdyStreamId last_good_stream_id) {
+ for (int i = 0; i < NUM_PRIORITIES; ++i) {
+ // Do the actual deletion and removal, preserving FIFO-ness.
+ std::deque<PendingWrite>* queue = &queue_[i];
+ std::deque<PendingWrite>::iterator out_it = queue->begin();
+ for (std::deque<PendingWrite>::const_iterator it = queue->begin();
+ it != queue->end(); ++it) {
+ if (it->stream && (it->stream->stream_id() > last_good_stream_id ||
+ it->stream->stream_id() == 0)) {
+ delete it->frame_producer;
+ } else {
+ *out_it = *it;
+ ++out_it;
+ }
+ }
+ queue->erase(out_it, queue->end());
+ }
+}
+
void SpdyWriteQueue::Clear() {
for (int i = 0; i < NUM_PRIORITIES; ++i) {
for (std::deque<PendingWrite>::iterator it = queue_[i].begin();
« no previous file with comments | « net/spdy/spdy_write_queue.h ('k') | net/spdy/spdy_write_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698