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

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

Issue 16226028: Fix even more remaining uses of WeakPtr<T>'s operator T* conversion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/http/http_cache_unittest.cc ('k') | net/url_request/url_request_ftp_job_unittest.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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « net/http/http_cache_unittest.cc ('k') | net/url_request/url_request_ftp_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698