| OLD | NEW |
| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 const base::WeakPtr<SpdyStream>& stream) { | 64 const base::WeakPtr<SpdyStream>& stream) { |
| 65 DCHECK(stream.get()); | 65 DCHECK(stream.get()); |
| 66 if (DCHECK_IS_ON()) { | 66 if (DCHECK_IS_ON()) { |
| 67 // |stream| should not have pending writes in a queue not matching | 67 // |stream| should not have pending writes in a queue not matching |
| 68 // its priority. | 68 // its priority. |
| 69 for (int i = 0; i < NUM_PRIORITIES; ++i) { | 69 for (int i = 0; i < NUM_PRIORITIES; ++i) { |
| 70 if (stream->priority() == i) | 70 if (stream->priority() == i) |
| 71 continue; | 71 continue; |
| 72 for (std::deque<PendingWrite>::const_iterator it = queue_[i].begin(); | 72 for (std::deque<PendingWrite>::const_iterator it = queue_[i].begin(); |
| 73 it != queue_[i].end(); ++it) { | 73 it != queue_[i].end(); ++it) { |
| 74 DCHECK_NE(it->stream, stream); | 74 DCHECK_NE(it->stream.get(), stream.get()); |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 } | 77 } |
| 78 | 78 |
| 79 // Do the actual deletion and removal, preserving FIFO-ness. | 79 // Do the actual deletion and removal, preserving FIFO-ness. |
| 80 std::deque<PendingWrite>* queue = &queue_[stream->priority()]; | 80 std::deque<PendingWrite>* queue = &queue_[stream->priority()]; |
| 81 std::deque<PendingWrite>::iterator out_it = queue->begin(); | 81 std::deque<PendingWrite>::iterator out_it = queue->begin(); |
| 82 for (std::deque<PendingWrite>::const_iterator it = queue->begin(); | 82 for (std::deque<PendingWrite>::const_iterator it = queue->begin(); |
| 83 it != queue->end(); ++it) { | 83 it != queue->end(); ++it) { |
| 84 if (it->stream.get() == stream.get()) { | 84 if (it->stream.get() == stream.get()) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 115 for (int i = 0; i < NUM_PRIORITIES; ++i) { | 115 for (int i = 0; i < NUM_PRIORITIES; ++i) { |
| 116 for (std::deque<PendingWrite>::iterator it = queue_[i].begin(); | 116 for (std::deque<PendingWrite>::iterator it = queue_[i].begin(); |
| 117 it != queue_[i].end(); ++it) { | 117 it != queue_[i].end(); ++it) { |
| 118 delete it->frame_producer; | 118 delete it->frame_producer; |
| 119 } | 119 } |
| 120 queue_[i].clear(); | 120 queue_[i].clear(); |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace net | 124 } // namespace net |
| OLD | NEW |