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

Side by Side Diff: components/sync/api/metadata_batch.h

Issue 2401223002: [Sync] Renaming sync/api* to sync/model*. (Closed)
Patch Set: Missed a comment in a DEPS file, and rebasing. 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
« no previous file with comments | « components/sync/api/local_change_observer.h ('k') | components/sync/api/metadata_batch.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #ifndef COMPONENTS_SYNC_API_METADATA_BATCH_H_
6 #define COMPONENTS_SYNC_API_METADATA_BATCH_H_
7
8 #include <map>
9 #include <string>
10
11 #include "components/sync/protocol/entity_metadata.pb.h"
12 #include "components/sync/protocol/model_type_state.pb.h"
13
14 namespace syncer {
15
16 // Map of storage keys to EntityMetadata proto.
17 typedef std::map<std::string, sync_pb::EntityMetadata> EntityMetadataMap;
18
19 // Container used to pass sync metadata from services to their processor.
20 class MetadataBatch {
21 public:
22 MetadataBatch();
23 virtual ~MetadataBatch();
24
25 // Allows the caller to take ownership of the entire metadata map. This is
26 // done because the caller will probably swap out all the EntityMetadata
27 // protos from the map for performance reasons.
28 EntityMetadataMap&& TakeAllMetadata();
29
30 // Add |metadata| for |storage_key| to the batch.
31 void AddMetadata(const std::string& storage_key,
32 const sync_pb::EntityMetadata& metadata);
33
34 // Get the ModelTypeState for this batch.
35 const sync_pb::ModelTypeState& GetModelTypeState() const;
36
37 // Set the ModelTypeState for this batch.
38 void SetModelTypeState(const sync_pb::ModelTypeState& state);
39
40 private:
41 EntityMetadataMap metadata_map_;
42 sync_pb::ModelTypeState state_;
43 };
44
45 } // namespace syncer
46
47 #endif // COMPONENTS_SYNC_API_METADATA_BATCH_H_
OLDNEW
« no previous file with comments | « components/sync/api/local_change_observer.h ('k') | components/sync/api/metadata_batch.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698