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

Unified Diff: sync/api/entity_change.h

Issue 1458013003: [Sync] USS: Add EntityChange. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@uss-data
Patch Set: Rebase. Created 5 years, 1 month 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 | « sync/BUILD.gn ('k') | sync/api/entity_change.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/api/entity_change.h
diff --git a/sync/api/entity_change.h b/sync/api/entity_change.h
new file mode 100644
index 0000000000000000000000000000000000000000..be7fe548775cb6f4e01e6b024a6f6c03e4b02198
--- /dev/null
+++ b/sync/api/entity_change.h
@@ -0,0 +1,45 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYNC_API_ENTITY_CHANGE_H_
+#define SYNC_API_ENTITY_CHANGE_H_
+
+#include <string>
+
+#include "sync/api/entity_data.h"
+#include "sync/base/sync_export.h"
+
+namespace syncer_v2 {
+
+class SYNC_EXPORT EntityChange {
+ public:
+ enum ChangeType {
+ ADD,
+ UPDATE,
+ DELETE,
+ };
+
+ static EntityChange CreateAdd(std::string client_tag, EntityDataPtr data);
stanisc 2015/11/20 19:01:49 I am not sure we need these 3 functions as a part
maxbogue 2015/11/20 19:53:25 Filed http://crbug.com/559276.
+ static EntityChange CreateUpdate(std::string client_tag, EntityDataPtr data);
+ static EntityChange CreateDelete(std::string client_tag);
+
+ virtual ~EntityChange();
+
+ std::string client_tag() const { return client_tag_; }
+ ChangeType type() const { return type_; }
+ EntityDataPtr data() const { return data_; }
stanisc 2015/11/20 19:01:49 This should be const EntityData&
maxbogue 2015/11/20 19:53:25 Done.
+
+ private:
+ EntityChange(std::string client_tag, ChangeType type, EntityDataPtr data);
+
+ const std::string client_tag_;
+ const ChangeType type_;
+ const EntityDataPtr data_;
+};
+
+typedef std::vector<EntityChange> EntityChangeList;
+
+} // namespace syncer_v2
+
+#endif // SYNC_API_ENTITY_CHANGE_H_
« no previous file with comments | « sync/BUILD.gn ('k') | sync/api/entity_change.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698