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

Side by Side Diff: components/sync/core_impl/protocol_event_buffer.cc

Issue 2387553002: [Sync] Removing duplicated includes between cc and h files. (Closed)
Patch Set: Fixing DataTypeStatusTable 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
OLDNEW
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 "components/sync/core_impl/protocol_event_buffer.h" 5 #include "components/sync/core_impl/protocol_event_buffer.h"
6 6
7 #include <stddef.h>
8
9 #include "components/sync/engine/events/protocol_event.h" 7 #include "components/sync/engine/events/protocol_event.h"
10 8
11 namespace syncer { 9 namespace syncer {
12 10
13 const size_t ProtocolEventBuffer::kBufferSize = 6; 11 const size_t ProtocolEventBuffer::kBufferSize = 6;
14 12
15 ProtocolEventBuffer::ProtocolEventBuffer() {} 13 ProtocolEventBuffer::ProtocolEventBuffer() {}
16 14
17 ProtocolEventBuffer::~ProtocolEventBuffer() {} 15 ProtocolEventBuffer::~ProtocolEventBuffer() {}
18 16
19 void ProtocolEventBuffer::RecordProtocolEvent(const ProtocolEvent& event) { 17 void ProtocolEventBuffer::RecordProtocolEvent(const ProtocolEvent& event) {
20 buffer_.push_back(event.Clone()); 18 buffer_.push_back(event.Clone());
21 if (buffer_.size() > kBufferSize) 19 if (buffer_.size() > kBufferSize)
22 buffer_.pop_front(); 20 buffer_.pop_front();
23 } 21 }
24 22
25 std::vector<std::unique_ptr<ProtocolEvent>> 23 std::vector<std::unique_ptr<ProtocolEvent>>
26 ProtocolEventBuffer::GetBufferedProtocolEvents() const { 24 ProtocolEventBuffer::GetBufferedProtocolEvents() const {
27 std::vector<std::unique_ptr<ProtocolEvent>> ret; 25 std::vector<std::unique_ptr<ProtocolEvent>> ret;
28 for (auto& event : buffer_) 26 for (auto& event : buffer_)
29 ret.push_back(event->Clone()); 27 ret.push_back(event->Clone());
30 28
31 return ret; 29 return ret;
32 } 30 }
33 31
34 } // namespace syncer 32 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/core_impl/js_mutation_event_observer.cc ('k') | components/sync/core_impl/sync_encryption_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698