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

Side by Side Diff: sync/internal_api/public/simple_metadata_change_list.h

Issue 1678343002: [Sync] Moving DataTypeState to proto for serialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update for Pavel and merging with Max's changes. Created 4 years, 10 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 #ifndef SYNC_INTERNAL_API_PUBLIC_SIMPLE_METADATA_CHANGE_LIST_H_ 5 #ifndef SYNC_INTERNAL_API_PUBLIC_SIMPLE_METADATA_CHANGE_LIST_H_
6 #define SYNC_INTERNAL_API_PUBLIC_SIMPLE_METADATA_CHANGE_LIST_H_ 6 #define SYNC_INTERNAL_API_PUBLIC_SIMPLE_METADATA_CHANGE_LIST_H_
7 7
8 #include <string>
9
8 #include "sync/api/metadata_change_list.h" 10 #include "sync/api/metadata_change_list.h"
9 #include "sync/api/model_type_store.h" 11 #include "sync/api/model_type_store.h"
10 #include "sync/base/sync_export.h" 12 #include "sync/base/sync_export.h"
11 13
12 namespace syncer_v2 { 14 namespace syncer_v2 {
13 15
14 // A MetadataChangeList implementation that is meant to be used in combination 16 // A MetadataChangeList implementation that is meant to be used in combination
15 // with a ModelTypeStore. It accumulates changes in member fields, and then when 17 // with a ModelTypeStore. It accumulates changes in member fields, and then when
16 // requested transfers them to the store/write batch. 18 // requested transfers them to the store/write batch.
17 class SYNC_EXPORT SimpleMetadataChangeList : public MetadataChangeList { 19 class SYNC_EXPORT SimpleMetadataChangeList : public MetadataChangeList {
18 public: 20 public:
19 SimpleMetadataChangeList(); 21 SimpleMetadataChangeList();
20 ~SimpleMetadataChangeList() override; 22 ~SimpleMetadataChangeList() override;
21 23
22 void UpdateDataTypeState(const DataTypeState& data_type_state) override; 24 void UpdateDataTypeState(
25 const sync_pb::DataTypeState& data_type_state) override;
23 void ClearDataTypeState() override; 26 void ClearDataTypeState() override;
24 void UpdateMetadata(const std::string& client_tag, 27 void UpdateMetadata(const std::string& client_tag,
25 const sync_pb::EntityMetadata& metadata) override; 28 const sync_pb::EntityMetadata& metadata) override;
26 void ClearMetadata(const std::string& client_tag) override; 29 void ClearMetadata(const std::string& client_tag) override;
27 30
28 // Moves all currently accumulated changes into the write batch, clear out 31 // Moves all currently accumulated changes into the write batch, clear out
29 // local copies. Calling this multiple times will work, but should not be 32 // local copies. Calling this multiple times will work, but should not be
30 // necessary. 33 // necessary.
31 void TranfserChanges(ModelTypeStore* store, 34 void TranfserChanges(ModelTypeStore* store,
32 ModelTypeStore::WriteBatch* write_batch); 35 ModelTypeStore::WriteBatch* write_batch);
33 }; 36 };
34 37
35 } // namespace syncer_v2 38 } // namespace syncer_v2
36 39
37 #endif // SYNC_INTERNAL_API_PUBLIC_SIMPLE_METADATA_CHANGE_LIST_H_ 40 #endif // SYNC_INTERNAL_API_PUBLIC_SIMPLE_METADATA_CHANGE_LIST_H_
OLDNEW
« no previous file with comments | « sync/internal_api/public/shared_model_type_processor.h ('k') | sync/internal_api/public/simple_metadata_change_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698