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 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 void SpdyWriteQueue::RemovePendingWritesForStream( | 77 void SpdyWriteQueue::RemovePendingWritesForStream( |
78 const base::WeakPtr<SpdyStream>& stream) { | 78 const base::WeakPtr<SpdyStream>& stream) { |
79 CHECK(!removing_writes_); | 79 CHECK(!removing_writes_); |
80 removing_writes_ = true; | 80 removing_writes_ = true; |
81 RequestPriority priority = stream->priority(); | 81 RequestPriority priority = stream->priority(); |
82 CHECK_GE(priority, MINIMUM_PRIORITY); | 82 CHECK_GE(priority, MINIMUM_PRIORITY); |
83 CHECK_LE(priority, MAXIMUM_PRIORITY); | 83 CHECK_LE(priority, MAXIMUM_PRIORITY); |
84 | 84 |
85 DCHECK(stream.get()); | 85 DCHECK(stream.get()); |
86 #if DCHECK_IS_ON | 86 #if DCHECK_IS_ON() |
87 // |stream| should not have pending writes in a queue not matching | 87 // |stream| should not have pending writes in a queue not matching |
88 // its priority. | 88 // its priority. |
89 for (int i = MINIMUM_PRIORITY; i <= MAXIMUM_PRIORITY; ++i) { | 89 for (int i = MINIMUM_PRIORITY; i <= MAXIMUM_PRIORITY; ++i) { |
90 if (priority == i) | 90 if (priority == i) |
91 continue; | 91 continue; |
92 for (std::deque<PendingWrite>::const_iterator it = queue_[i].begin(); | 92 for (std::deque<PendingWrite>::const_iterator it = queue_[i].begin(); |
93 it != queue_[i].end(); ++it) { | 93 it != queue_[i].end(); ++it) { |
94 DCHECK_NE(it->stream.get(), stream.get()); | 94 DCHECK_NE(it->stream.get(), stream.get()); |
95 } | 95 } |
96 } | 96 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 it != queue_[i].end(); ++it) { | 153 it != queue_[i].end(); ++it) { |
154 erased_buffer_producers.push_back(it->frame_producer); | 154 erased_buffer_producers.push_back(it->frame_producer); |
155 } | 155 } |
156 queue_[i].clear(); | 156 queue_[i].clear(); |
157 } | 157 } |
158 removing_writes_ = false; | 158 removing_writes_ = false; |
159 STLDeleteElements(&erased_buffer_producers); // Invokes callbacks. | 159 STLDeleteElements(&erased_buffer_producers); // Invokes callbacks. |
160 } | 160 } |
161 | 161 |
162 } // namespace net | 162 } // namespace net |
OLD | NEW |