| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/sync/core/data_batch_impl.h" | |
| 6 | |
| 7 namespace syncer { | |
| 8 | |
| 9 DataBatchImpl::DataBatchImpl() {} | |
| 10 | |
| 11 DataBatchImpl::~DataBatchImpl() {} | |
| 12 | |
| 13 void DataBatchImpl::Put(const std::string& storage_key, | |
| 14 std::unique_ptr<EntityData> specifics) { | |
| 15 key_data_pairs_.push_back(KeyAndData(storage_key, std::move(specifics))); | |
| 16 } | |
| 17 | |
| 18 bool DataBatchImpl::HasNext() const { | |
| 19 return key_data_pairs_.size() > read_index_; | |
| 20 } | |
| 21 | |
| 22 KeyAndData DataBatchImpl::Next() { | |
| 23 DCHECK(HasNext()); | |
| 24 return std::move(key_data_pairs_[read_index_++]); | |
| 25 } | |
| 26 | |
| 27 } // namespace syncer | |
| OLD | NEW |