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

Side by Side Diff: net/spdy/spdy_read_queue.h

Issue 2388243003: Add test for SpdyReadQueue::Clear(). (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | net/spdy/spdy_read_queue.cc » ('j') | net/spdy/spdy_read_queue_unittest.cc » ('J')
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 #ifndef NET_SPDY_SPDY_BUFFER_QUEUE_H_ 5 #ifndef NET_SPDY_SPDY_BUFFER_QUEUE_H_
6 #define NET_SPDY_SPDY_BUFFER_QUEUE_H_ 6 #define NET_SPDY_SPDY_BUFFER_QUEUE_H_
7 7
8 #include <cstddef> 8 #include <cstddef>
9 #include <deque> 9 #include <deque>
10 #include <memory> 10 #include <memory>
(...skipping 22 matching lines...) Expand all
33 void Enqueue(std::unique_ptr<SpdyBuffer> buffer); 33 void Enqueue(std::unique_ptr<SpdyBuffer> buffer);
34 34
35 // Dequeues up to |len| (which must be positive) bytes into 35 // Dequeues up to |len| (which must be positive) bytes into
36 // |out|. Returns the number of bytes dequeued. 36 // |out|. Returns the number of bytes dequeued.
37 size_t Dequeue(char* out, size_t len); 37 size_t Dequeue(char* out, size_t len);
38 38
39 // Removes all bytes from the queue. 39 // Removes all bytes from the queue.
40 void Clear(); 40 void Clear();
41 41
42 private: 42 private:
43 // Class invariant:
44 // |total_size_| is the sum of GetRemainingSize() of |queue_|'s elements.
43 std::deque<std::unique_ptr<SpdyBuffer>> queue_; 45 std::deque<std::unique_ptr<SpdyBuffer>> queue_;
44 size_t total_size_; 46 size_t total_size_;
45 47
46 DISALLOW_COPY_AND_ASSIGN(SpdyReadQueue); 48 DISALLOW_COPY_AND_ASSIGN(SpdyReadQueue);
47 }; 49 };
48 50
49 } // namespace net 51 } // namespace net
50 52
51 #endif // NET_SPDY_SPDY_BUFFER_QUEUE_H_ 53 #endif // NET_SPDY_SPDY_BUFFER_QUEUE_H_
OLDNEW
« no previous file with comments | « no previous file | net/spdy/spdy_read_queue.cc » ('j') | net/spdy/spdy_read_queue_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698