summaryrefslogtreecommitdiffstats
path: root/sync/protocol
diff options
context:
space:
mode:
authormaniscalco@chromium.org <maniscalco@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-02 22:42:14 +0000
committermaniscalco@chromium.org <maniscalco@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-02 22:42:14 +0000
commitd0fcac09a5259cf728931e91f87c26806ae99548 (patch)
treeb1868f9b4f41c78d9150a66e7466d0cafeef0f59 /sync/protocol
parent7ffa8815e1e13ede3313951fc001eba0fe9d9ef8 (diff)
downloadchromium_src-d0fcac09a5259cf728931e91f87c26806ae99548.zip
chromium_src-d0fcac09a5259cf728931e91f87c26806ae99548.tar.gz
chromium_src-d0fcac09a5259cf728931e91f87c26806ae99548.tar.bz2
Checkpointing some Sync Attachment work. Added SyncAttachment and SyncAttachmentId. The interfaces are still in flux and will likely change.
Review URL: https://codereview.chromium.org/102193004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242818 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/protocol')
-rw-r--r--sync/protocol/attachments.proto24
-rw-r--r--sync/protocol/proto_value_conversions.cc7
-rw-r--r--sync/protocol/proto_value_conversions.h4
-rw-r--r--sync/protocol/proto_value_conversions_unittest.cc4
-rw-r--r--sync/protocol/sync.proto1
5 files changed, 40 insertions, 0 deletions
diff --git a/sync/protocol/attachments.proto b/sync/protocol/attachments.proto
new file mode 100644
index 0000000..4dd85fd
--- /dev/null
+++ b/sync/protocol/attachments.proto
@@ -0,0 +1,24 @@
+// Copyright 2014 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.
+//
+// Sync protocol for attachments.
+
+// Update proto_{value,enum}_conversions{.h,.cc,_unittest.cc} if you change any
+// fields in this file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+option retain_unknown_fields = true;
+
+package sync_pb;
+
+// Identifies an attachment.
+//
+// Note, message's definition is in flux and may change. Don't rely on it.
+message SyncAttachmentId {
+ // Uniquely identifies the attachment. Two attachments with the same unique_id
+ // are considered equivalent.
+ optional string unique_id = 1;
+}
diff --git a/sync/protocol/proto_value_conversions.cc b/sync/protocol/proto_value_conversions.cc
index a7ccdf2..4b7e495 100644
--- a/sync/protocol/proto_value_conversions.cc
+++ b/sync/protocol/proto_value_conversions.cc
@@ -1024,6 +1024,13 @@ base::DictionaryValue* ClientConfigParamsToValue(
return value;
}
+base::DictionaryValue* SyncAttachmentIdToValue(
+ const sync_pb::SyncAttachmentId& proto) {
+ base::DictionaryValue* value = new base::DictionaryValue();
+ SET_STR(unique_id);
+ return value;
+}
+
#undef SET
#undef SET_REP
diff --git a/sync/protocol/proto_value_conversions.h b/sync/protocol/proto_value_conversions.h
index 9357031..3c8f3d9 100644
--- a/sync/protocol/proto_value_conversions.h
+++ b/sync/protocol/proto_value_conversions.h
@@ -60,6 +60,7 @@ class SessionSpecifics;
class SessionTab;
class SessionWindow;
class SimpleCollapsedLayout;
+class SyncAttachmentId;
class SyncCycleCompletedEventInfo;
class SyncedNotification;
class SyncedNotificationAction;
@@ -289,6 +290,9 @@ base::DictionaryValue* SyncCycleCompletedEventInfoToValue(
base::DictionaryValue* ClientConfigParamsToValue(
const sync_pb::ClientConfigParams& proto);
+SYNC_EXPORT_PRIVATE base::DictionaryValue* SyncAttachmentIdToValue(
+ const sync_pb::SyncAttachmentId& proto);
+
} // namespace syncer
#endif // SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_
diff --git a/sync/protocol/proto_value_conversions_unittest.cc b/sync/protocol/proto_value_conversions_unittest.cc
index 986c7a9..11c9674 100644
--- a/sync/protocol/proto_value_conversions_unittest.cc
+++ b/sync/protocol/proto_value_conversions_unittest.cc
@@ -363,5 +363,9 @@ TEST_F(ProtoValueConversionsTest, ClientToServerResponseToValue) {
"get_updates.entries"));
}
+TEST_F(ProtoValueConversionsTest, SyncAttachmentIdToValue) {
+ TestSpecificsToValue(SyncAttachmentIdToValue);
+}
+
} // namespace
} // namespace syncer
diff --git a/sync/protocol/sync.proto b/sync/protocol/sync.proto
index 449c836..ee051cd 100644
--- a/sync/protocol/sync.proto
+++ b/sync/protocol/sync.proto
@@ -19,6 +19,7 @@ import "app_notification_specifics.proto";
import "app_setting_specifics.proto";
import "app_specifics.proto";
import "article_specifics.proto";
+import "attachments.proto";
import "autofill_specifics.proto";
import "bookmark_specifics.proto";
import "client_commands.proto";