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_read_queue.h" | 5 #include "net/spdy/spdy_read_queue.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "net/spdy/spdy_buffer.h" | 9 #include "net/spdy/spdy_buffer.h" |
10 | 10 |
11 namespace net { | 11 namespace net { |
12 | 12 |
13 SpdyReadQueue::SpdyReadQueue() : total_size_(0) {} | 13 SpdyReadQueue::SpdyReadQueue() : total_size_(0) { |
| 14 } |
14 | 15 |
15 SpdyReadQueue::~SpdyReadQueue() { | 16 SpdyReadQueue::~SpdyReadQueue() { |
16 Clear(); | 17 Clear(); |
17 } | 18 } |
18 | 19 |
19 bool SpdyReadQueue::IsEmpty() const { | 20 bool SpdyReadQueue::IsEmpty() const { |
20 DCHECK_EQ(queue_.empty(), total_size_ == 0); | 21 DCHECK_EQ(queue_.empty(), total_size_ == 0); |
21 return queue_.empty(); | 22 return queue_.empty(); |
22 } | 23 } |
23 | 24 |
(...skipping 26 matching lines...) Expand all Loading... |
50 total_size_ -= bytes_copied; | 51 total_size_ -= bytes_copied; |
51 return bytes_copied; | 52 return bytes_copied; |
52 } | 53 } |
53 | 54 |
54 void SpdyReadQueue::Clear() { | 55 void SpdyReadQueue::Clear() { |
55 STLDeleteElements(&queue_); | 56 STLDeleteElements(&queue_); |
56 queue_.clear(); | 57 queue_.clear(); |
57 } | 58 } |
58 | 59 |
59 } // namespace | 60 } // namespace |
OLD | NEW |