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

Unified Diff: sync/api/entity_change.cc

Issue 1458013003: [Sync] USS: Add EntityChange. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@uss-data
Patch Set: s/client_tag/client_key/ etc 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/api/entity_change.h ('k') | sync/api/model_type_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/api/entity_change.cc
diff --git a/sync/api/entity_change.cc b/sync/api/entity_change.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e2f2bedb9cce9db25dd3a9cb4f1f4c5197100bb6
--- /dev/null
+++ b/sync/api/entity_change.cc
@@ -0,0 +1,33 @@
+// 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.
+
+#include "sync/api/entity_change.h"
+
+namespace syncer_v2 {
+
+// static
+EntityChange EntityChange::CreateAdd(std::string client_key,
+ EntityDataPtr data) {
+ return EntityChange(client_key, ACTION_ADD, data);
+}
+
+// static
+EntityChange EntityChange::CreateUpdate(std::string client_key,
+ EntityDataPtr data) {
+ return EntityChange(client_key, ACTION_UPDATE, data);
+}
+
+// static
+EntityChange EntityChange::CreateDelete(std::string client_key) {
+ return EntityChange(client_key, ACTION_DELETE, EntityDataPtr());
+}
+
+EntityChange::EntityChange(std::string client_key,
+ ChangeType type,
+ EntityDataPtr data)
+ : client_key_(client_key), type_(type), data_(data){};
+
+EntityChange::~EntityChange() {}
+
+} // namespace syncer_v2
« no previous file with comments | « sync/api/entity_change.h ('k') | sync/api/model_type_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698