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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "net/spdy/spdy_write_queue.h" 5 #include "net/spdy/spdy_write_queue.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "net/spdy/spdy_buffer.h" 10 #include "net/spdy/spdy_buffer.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 if (it->stream == stream) { 82 if (it->stream == stream) {
83 delete it->frame_producer; 83 delete it->frame_producer;
84 } else { 84 } else {
85 *out_it = *it; 85 *out_it = *it;
86 ++out_it; 86 ++out_it;
87 } 87 }
88 } 88 }
89 queue->erase(out_it, queue->end()); 89 queue->erase(out_it, queue->end());
90 } 90 }
91 91
92 void SpdyWriteQueue::RemovePendingWritesForStreamsAfter(
93 SpdyStreamId last_good_stream_id) {
94 for (int i = 0; i < NUM_PRIORITIES; ++i) {
95 // Do the actual deletion and removal, preserving FIFO-ness.
96 std::deque<PendingWrite>* queue = &queue_[i];
97 std::deque<PendingWrite>::iterator out_it = queue->begin();
98 for (std::deque<PendingWrite>::const_iterator it = queue->begin();
99 it != queue->end(); ++it) {
100 if (it->stream && (it->stream->stream_id() > last_good_stream_id ||
101 it->stream->stream_id() == 0)) {
102 delete it->frame_producer;
103 } else {
104 *out_it = *it;
105 ++out_it;
106 }
107 }
108 queue->erase(out_it, queue->end());
109 }
110 }
111
92 void SpdyWriteQueue::Clear() { 112 void SpdyWriteQueue::Clear() {
93 for (int i = 0; i < NUM_PRIORITIES; ++i) { 113 for (int i = 0; i < NUM_PRIORITIES; ++i) {
94 for (std::deque<PendingWrite>::iterator it = queue_[i].begin(); 114 for (std::deque<PendingWrite>::iterator it = queue_[i].begin();
95 it != queue_[i].end(); ++it) { 115 it != queue_[i].end(); ++it) {
96 delete it->frame_producer; 116 delete it->frame_producer;
97 } 117 }
98 queue_[i].clear(); 118 queue_[i].clear();
99 } 119 }
100 } 120 }
101 121
102 } // namespace net 122 } // namespace net
OLDNEW
« 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