OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "sync/internal_api/protocol_event_buffer.h" | 5 #include "sync/internal_api/protocol_event_buffer.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include "sync/internal_api/public/events/protocol_event.h" | 9 #include "sync/internal_api/public/events/protocol_event.h" |
8 | 10 |
9 namespace syncer { | 11 namespace syncer { |
10 | 12 |
11 const size_t ProtocolEventBuffer::kBufferSize = 6; | 13 const size_t ProtocolEventBuffer::kBufferSize = 6; |
12 | 14 |
13 ProtocolEventBuffer::ProtocolEventBuffer() | 15 ProtocolEventBuffer::ProtocolEventBuffer() |
14 : buffer_deleter_(&buffer_) {} | 16 : buffer_deleter_(&buffer_) {} |
15 | 17 |
16 ProtocolEventBuffer::~ProtocolEventBuffer() {} | 18 ProtocolEventBuffer::~ProtocolEventBuffer() {} |
(...skipping 11 matching lines...) Expand all Loading... |
28 ProtocolEventBuffer::GetBufferedProtocolEvents() const { | 30 ProtocolEventBuffer::GetBufferedProtocolEvents() const { |
29 ScopedVector<ProtocolEvent> ret; | 31 ScopedVector<ProtocolEvent> ret; |
30 for (std::deque<ProtocolEvent*>::const_iterator it = buffer_.begin(); | 32 for (std::deque<ProtocolEvent*>::const_iterator it = buffer_.begin(); |
31 it != buffer_.end(); ++it) { | 33 it != buffer_.end(); ++it) { |
32 ret.push_back((*it)->Clone().Pass()); | 34 ret.push_back((*it)->Clone().Pass()); |
33 } | 35 } |
34 return ret.Pass(); | 36 return ret.Pass(); |
35 } | 37 } |
36 | 38 |
37 } // namespace syncer | 39 } // namespace syncer |
OLD | NEW |