| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 return false; | 70 return false; |
| 71 } | 71 } |
| 72 | 72 |
| 73 void SpdyWriteQueue::RemovePendingWritesForStream( | 73 void SpdyWriteQueue::RemovePendingWritesForStream( |
| 74 const base::WeakPtr<SpdyStream>& stream) { | 74 const base::WeakPtr<SpdyStream>& stream) { |
| 75 RequestPriority priority = stream->priority(); | 75 RequestPriority priority = stream->priority(); |
| 76 CHECK_GE(priority, MINIMUM_PRIORITY); | 76 CHECK_GE(priority, MINIMUM_PRIORITY); |
| 77 CHECK_LE(priority, MAXIMUM_PRIORITY); | 77 CHECK_LE(priority, MAXIMUM_PRIORITY); |
| 78 | 78 |
| 79 DCHECK(stream.get()); | 79 DCHECK(stream.get()); |
| 80 if (DCHECK_IS_ON()) { | 80 if (DCHECK_IS_ON) { |
| 81 // |stream| should not have pending writes in a queue not matching | 81 // |stream| should not have pending writes in a queue not matching |
| 82 // its priority. | 82 // its priority. |
| 83 for (int i = MINIMUM_PRIORITY; i <= MAXIMUM_PRIORITY; ++i) { | 83 for (int i = MINIMUM_PRIORITY; i <= MAXIMUM_PRIORITY; ++i) { |
| 84 if (priority == i) | 84 if (priority == i) |
| 85 continue; | 85 continue; |
| 86 for (std::deque<PendingWrite>::const_iterator it = queue_[i].begin(); | 86 for (std::deque<PendingWrite>::const_iterator it = queue_[i].begin(); |
| 87 it != queue_[i].end(); ++it) { | 87 it != queue_[i].end(); ++it) { |
| 88 DCHECK_NE(it->stream.get(), stream.get()); | 88 DCHECK_NE(it->stream.get(), stream.get()); |
| 89 } | 89 } |
| 90 } | 90 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 for (int i = MINIMUM_PRIORITY; i <= MAXIMUM_PRIORITY; ++i) { | 129 for (int i = MINIMUM_PRIORITY; i <= MAXIMUM_PRIORITY; ++i) { |
| 130 for (std::deque<PendingWrite>::iterator it = queue_[i].begin(); | 130 for (std::deque<PendingWrite>::iterator it = queue_[i].begin(); |
| 131 it != queue_[i].end(); ++it) { | 131 it != queue_[i].end(); ++it) { |
| 132 delete it->frame_producer; | 132 delete it->frame_producer; |
| 133 } | 133 } |
| 134 queue_[i].clear(); | 134 queue_[i].clear(); |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace net | 138 } // namespace net |
| OLD | NEW |