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

Side by Side Diff: net/spdy/spdy_write_queue.cc

Issue 195973002: Change DCHECK_IS_ON() to DCHECK_IS_ON (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Keep a comment Created 6 years, 9 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_session.cc ('k') | sync/internal_api/http_bridge.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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
90 } 89 }
91 } 90 }
91 #endif
92 92
93 // Do the actual deletion and removal, preserving FIFO-ness. 93 // Do the actual deletion and removal, preserving FIFO-ness.
94 std::deque<PendingWrite>* queue = &queue_[priority]; 94 std::deque<PendingWrite>* queue = &queue_[priority];
95 std::deque<PendingWrite>::iterator out_it = queue->begin(); 95 std::deque<PendingWrite>::iterator out_it = queue->begin();
96 for (std::deque<PendingWrite>::const_iterator it = queue->begin(); 96 for (std::deque<PendingWrite>::const_iterator it = queue->begin();
97 it != queue->end(); ++it) { 97 it != queue->end(); ++it) {
98 if (it->stream.get() == stream.get()) { 98 if (it->stream.get() == stream.get()) {
99 delete it->frame_producer; 99 delete it->frame_producer;
100 } else { 100 } else {
101 *out_it = *it; 101 *out_it = *it;
(...skipping 27 matching lines...) Expand all
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
OLDNEW
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | sync/internal_api/http_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698