summaryrefslogtreecommitdiffstats
path: root/sync/protocol
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-04 04:23:14 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-04 04:23:14 +0000
commiteb38cf795583ea03914f7748f978cd08be0d03e9 (patch)
tree1465c35c90963f327deddda42ff6ffb4d1caa920 /sync/protocol
parent3d4186832b70e34cf4144d7f4a870dd6fb9d3b0f (diff)
downloadchromium_src-eb38cf795583ea03914f7748f978cd08be0d03e9.zip
chromium_src-eb38cf795583ea03914f7748f978cd08be0d03e9.tar.gz
chromium_src-eb38cf795583ea03914f7748f978cd08be0d03e9.tar.bz2
[Sync] Add context proto and directory support
Still not hooked up to anything, but the proto and directory persistence are now there. BUG=358352 Review URL: https://codereview.chromium.org/218623014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261666 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/protocol')
-rw-r--r--sync/protocol/proto_value_conversions.cc11
-rw-r--r--sync/protocol/sync.proto20
2 files changed, 31 insertions, 0 deletions
diff --git a/sync/protocol/proto_value_conversions.cc b/sync/protocol/proto_value_conversions.cc
index 4e89928..06ecdfe 100644
--- a/sync/protocol/proto_value_conversions.cc
+++ b/sync/protocol/proto_value_conversions.cc
@@ -867,6 +867,15 @@ base::DictionaryValue* DataTypeProgressMarkerToValue(
return value;
}
+base::DictionaryValue* DataTypeContextToValue(
+ const sync_pb::DataTypeContext& proto) {
+ base::DictionaryValue* value = new base::DictionaryValue();
+ SET_INT32(data_type_id);
+ SET_STR(context);
+ SET_INT64(version);
+ return value;
+}
+
base::DictionaryValue* GetUpdatesCallerInfoToValue(
const sync_pb::GetUpdatesCallerInfo& proto) {
base::DictionaryValue* value = new base::DictionaryValue();
@@ -886,6 +895,7 @@ base::DictionaryValue* GetUpdatesMessageToValue(
SET_BOOL(need_encryption_key);
SET_BOOL(create_mobile_bookmarks_folder);
SET_ENUM(get_updates_origin, GetUpdatesOriginString);
+ SET_REP(client_contexts, DataTypeContextToValue);
return value;
}
@@ -924,6 +934,7 @@ base::DictionaryValue* GetUpdatesResponseToValue(
SyncEntitiesToValue(proto.entries(), include_specifics));
SET_INT64(changes_remaining);
SET_REP(new_progress_marker, DataTypeProgressMarkerToValue);
+ SET_REP(context_mutations, DataTypeContextToValue);
return value;
}
diff --git a/sync/protocol/sync.proto b/sync/protocol/sync.proto
index 7b0c673..675c25b 100644
--- a/sync/protocol/sync.proto
+++ b/sync/protocol/sync.proto
@@ -412,6 +412,9 @@ message CommitMessage {
// syncing a particular data type regardless of whether a commit for that
// datatype is currently being sent up.
optional ClientConfigParams config_params = 4;
+
+ // Set of optional per-client datatype contexts.
+ repeated DataTypeContext client_contexts = 5;
};
// This message communicates additional per-type information related to
@@ -630,6 +633,9 @@ message GetUpdatesMessage {
// Whether this GU also serves as a retry GU. Any GU that happens after
// retry timer timeout is a retry GU effectively.
optional bool is_retry = 10 [default = false];
+
+ // Set of optional per-client datatype contexts.
+ repeated DataTypeContext client_contexts = 11;
};
message AuthenticateMessage {
@@ -673,6 +679,17 @@ message ClientStatus {
optional bool hierarchy_conflict_detected = 1;
}
+// A single datatype's sync context. Allows the datatype to pass along
+// datatype specific information with its own server backend.
+message DataTypeContext {
+ // The type this context is associated with.
+ optional int32 data_type_id = 1;
+ // The context for the datatype.
+ optional bytes context = 2;
+ // The version of the context.
+ optional int64 version = 3;
+}
+
message ClientToServerMessage {
required string share = 1;
optional int32 protocol_version = 2 [default = 31];
@@ -836,6 +853,9 @@ message GetUpdatesResponse {
// the server has updated the set of encryption keys (e.g. due to a key
// rotation).
repeated bytes encryption_keys = 6;
+
+ // Set of optional datatype contexts server mutations.
+ repeated DataTypeContext context_mutations = 7;
};
// The metadata response for GetUpdatesMessage. This response is sent when