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

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: 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
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 void SpdyWriteQueue::Clear() { 92 void SpdyWriteQueue::Clear() {
93 for (int i = 0; i < NUM_PRIORITIES; ++i) { 93 for (int i = 0; i < NUM_PRIORITIES; ++i) {
94 for (std::deque<PendingWrite>::iterator it = queue_[i].begin(); 94 for (std::deque<PendingWrite>::iterator it = queue_[i].begin();
95 it != queue_[i].end(); ++it) { 95 it != queue_[i].end(); ++it) {
96 delete it->frame_producer; 96 delete it->frame_producer;
97 } 97 }
98 queue_[i].clear(); 98 queue_[i].clear();
99 } 99 }
100 } 100 }
101 101
102 void SpdyWriteQueue::ClearAfter(SpdyStreamId last_good_stream_id) {
103 for (int i = 0; i < NUM_PRIORITIES; ++i) {
104 std::deque<PendingWrite>::iterator it = queue_[i].begin();
105 while (it != queue_[i].end()) {
106 if (it->stream->stream_id() > last_good_stream_id) {
107 delete it->frame_producer;
108 it = queue_[i].erase(it);
akalin 2013/04/17 21:14:20 unfortunately, deque::erase is O(n). Can you do so
Ryan Hamilton 2013/04/18 00:30:40 Done.
109 } else {
110 ++it;
111 }
112 }
113 }
114 }
115
102 } // namespace net 116 } // namespace net
OLDNEW
« net/spdy/spdy_test_util_spdy3.cc ('K') | « net/spdy/spdy_write_queue.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698