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

Side by Side Diff: components/sync/core/data_batch_impl.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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 2015 The Chromium Authors. All rights reserved. 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 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/public/data_batch_impl.h" 5 #include "components/sync/core/data_batch_impl.h"
6 6
7 namespace syncer_v2 { 7 namespace syncer_v2 {
8 8
9 DataBatchImpl::DataBatchImpl() {} 9 DataBatchImpl::DataBatchImpl() {}
10 10
11 DataBatchImpl::~DataBatchImpl() {} 11 DataBatchImpl::~DataBatchImpl() {}
12 12
13 void DataBatchImpl::Put(const std::string& client_tag, 13 void DataBatchImpl::Put(const std::string& client_tag,
14 std::unique_ptr<EntityData> specifics) { 14 std::unique_ptr<EntityData> specifics) {
15 tag_data_pairs_.push_back(TagAndData(client_tag, std::move(specifics))); 15 tag_data_pairs_.push_back(TagAndData(client_tag, std::move(specifics)));
16 } 16 }
17 17
18 bool DataBatchImpl::HasNext() const { 18 bool DataBatchImpl::HasNext() const {
19 return tag_data_pairs_.size() > read_index_; 19 return tag_data_pairs_.size() > read_index_;
20 } 20 }
21 21
22 TagAndData DataBatchImpl::Next() { 22 TagAndData DataBatchImpl::Next() {
23 DCHECK(HasNext()); 23 DCHECK(HasNext());
24 return std::move(tag_data_pairs_[read_index_++]); 24 return std::move(tag_data_pairs_[read_index_++]);
25 } 25 }
26 26
27 } // namespace syncer_v2 27 } // namespace syncer_v2
OLDNEW
« no previous file with comments | « components/sync/core/data_batch_impl.h ('k') | components/sync/core/data_batch_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698