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

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

Issue 269423003: Guard SpdyWriteQueue::Enqueue, and test all reentrancy points. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: requed => requeued Created 6 years, 7 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 | « no previous file | net/spdy/spdy_write_queue_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 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 28 matching lines...) Expand all
39 if (!queue_[i].empty()) 39 if (!queue_[i].empty())
40 return false; 40 return false;
41 } 41 }
42 return true; 42 return true;
43 } 43 }
44 44
45 void SpdyWriteQueue::Enqueue(RequestPriority priority, 45 void SpdyWriteQueue::Enqueue(RequestPriority priority,
46 SpdyFrameType frame_type, 46 SpdyFrameType frame_type,
47 scoped_ptr<SpdyBufferProducer> frame_producer, 47 scoped_ptr<SpdyBufferProducer> frame_producer,
48 const base::WeakPtr<SpdyStream>& stream) { 48 const base::WeakPtr<SpdyStream>& stream) {
49 CHECK(!removing_writes_);
49 CHECK_GE(priority, MINIMUM_PRIORITY); 50 CHECK_GE(priority, MINIMUM_PRIORITY);
50 CHECK_LE(priority, MAXIMUM_PRIORITY); 51 CHECK_LE(priority, MAXIMUM_PRIORITY);
51 if (stream.get()) 52 if (stream.get())
52 DCHECK_EQ(stream->priority(), priority); 53 DCHECK_EQ(stream->priority(), priority);
53 queue_[priority].push_back( 54 queue_[priority].push_back(
54 PendingWrite(frame_type, frame_producer.release(), stream)); 55 PendingWrite(frame_type, frame_producer.release(), stream));
55 } 56 }
56 57
57 bool SpdyWriteQueue::Dequeue(SpdyFrameType* frame_type, 58 bool SpdyWriteQueue::Dequeue(SpdyFrameType* frame_type,
58 scoped_ptr<SpdyBufferProducer>* frame_producer, 59 scoped_ptr<SpdyBufferProducer>* frame_producer,
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 it != queue_[i].end(); ++it) { 153 it != queue_[i].end(); ++it) {
153 erased_buffer_producers.push_back(it->frame_producer); 154 erased_buffer_producers.push_back(it->frame_producer);
154 } 155 }
155 queue_[i].clear(); 156 queue_[i].clear();
156 } 157 }
157 removing_writes_ = false; 158 removing_writes_ = false;
158 STLDeleteElements(&erased_buffer_producers); // Invokes callbacks. 159 STLDeleteElements(&erased_buffer_producers); // Invokes callbacks.
159 } 160 }
160 161
161 } // namespace net 162 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/spdy/spdy_write_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698