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

Unified Diff: sync/internal_api/public/simple_metadata_change_list.h

Issue 1691013002: [Sync] USS: Implement SimpleMetadataChangeList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@smtp3
Patch Set: Even more init syntax. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sync/internal_api/public/simple_metadata_change_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/public/simple_metadata_change_list.h
diff --git a/sync/internal_api/public/simple_metadata_change_list.h b/sync/internal_api/public/simple_metadata_change_list.h
index f302b12ff93109a0fc5fbb56c3ce3cdc16ff721a..9daaee49b1bc697fee54dc1fb73da443cf7a7d7e 100644
--- a/sync/internal_api/public/simple_metadata_change_list.h
+++ b/sync/internal_api/public/simple_metadata_change_list.h
@@ -5,11 +5,15 @@
#ifndef SYNC_INTERNAL_API_PUBLIC_SIMPLE_METADATA_CHANGE_LIST_H_
#define SYNC_INTERNAL_API_PUBLIC_SIMPLE_METADATA_CHANGE_LIST_H_
+#include <map>
#include <string>
#include "sync/api/metadata_change_list.h"
#include "sync/api/model_type_store.h"
#include "sync/base/sync_export.h"
+#include "sync/internal_api/public/non_blocking_sync_common.h"
skym 2016/02/18 16:11:10 Don't think you need this anymore.
+#include "sync/protocol/data_type_state.pb.h"
+#include "sync/protocol/entity_metadata.pb.h"
namespace syncer_v2 {
@@ -18,6 +22,20 @@ namespace syncer_v2 {
// requested transfers them to the store/write batch.
class SYNC_EXPORT SimpleMetadataChangeList : public MetadataChangeList {
public:
+ enum ChangeType { UPDATE, CLEAR };
+
+ struct MetadataChange {
+ ChangeType type;
+ sync_pb::EntityMetadata metadata;
+ };
+
+ struct DataTypeStateChange {
+ ChangeType type;
+ sync_pb::DataTypeState state;
+ };
+
+ typedef std::map<std::string, MetadataChange> MetadataChanges;
+
SimpleMetadataChangeList();
~SimpleMetadataChangeList() override;
@@ -28,11 +46,19 @@ class SYNC_EXPORT SimpleMetadataChangeList : public MetadataChangeList {
const sync_pb::EntityMetadata& metadata) override;
void ClearMetadata(const std::string& client_tag) override;
+ const MetadataChanges& GetMetadataChanges() const;
+ bool HasDataTypeStateChange() const;
+ const DataTypeStateChange& GetDataTypeStateChange() const;
+
// Moves all currently accumulated changes into the write batch, clear out
// local copies. Calling this multiple times will work, but should not be
// necessary.
- void TranfserChanges(ModelTypeStore* store,
+ void TransferChanges(ModelTypeStore* store,
ModelTypeStore::WriteBatch* write_batch);
+
+ private:
+ MetadataChanges metadata_changes_;
+ scoped_ptr<DataTypeStateChange> state_change_;
};
} // namespace syncer_v2
« no previous file with comments | « no previous file | sync/internal_api/public/simple_metadata_change_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698