summaryrefslogtreecommitdiffstats
path: root/sync/test
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-04 21:10:21 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-04 21:10:21 +0000
commitd7f9c93561d24d5f46b0b54a025a82224dc6b778 (patch)
tree6c1cd6e387b83f7541a1535d373321131e78abc2 /sync/test
parentb64e521a4734417c33bd6758296c8eb7c3a8fe3f (diff)
downloadchromium_src-d7f9c93561d24d5f46b0b54a025a82224dc6b778.zip
chromium_src-d7f9c93561d24d5f46b0b54a025a82224dc6b778.tar.gz
chromium_src-d7f9c93561d24d5f46b0b54a025a82224dc6b778.tar.bz2
[Sync] Add plumbing of context from client to server
The datatype context is now written into the directory and plumbed up to the server on every GetUpdates or Commit request. GetUpdatesResponses also now overwrite the context if the version returned is the same or higher. BUG=345420 Review URL: https://codereview.chromium.org/215973007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261873 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/test')
-rw-r--r--sync/test/engine/mock_update_handler.cc12
-rw-r--r--sync/test/engine/mock_update_handler.h3
2 files changed, 12 insertions, 3 deletions
diff --git a/sync/test/engine/mock_update_handler.cc b/sync/test/engine/mock_update_handler.cc
index 098086e..da2db88 100644
--- a/sync/test/engine/mock_update_handler.cc
+++ b/sync/test/engine/mock_update_handler.cc
@@ -24,10 +24,16 @@ void MockUpdateHandler::GetDownloadProgress(
progress_marker->CopyFrom(progress_marker_);
}
+void MockUpdateHandler::GetDataTypeContext(
+ sync_pb::DataTypeContext* context) const {
+ context->Clear();
+}
+
void MockUpdateHandler::ProcessGetUpdatesResponse(
- const sync_pb::DataTypeProgressMarker& progress_marker,
- const SyncEntityList& applicable_updates,
- sessions::StatusController* status) {
+ const sync_pb::DataTypeProgressMarker& progress_marker,
+ const sync_pb::DataTypeContext& mutated_context,
+ const SyncEntityList& applicable_updates,
+ sessions::StatusController* status) {
progress_marker_.CopyFrom(progress_marker);
}
diff --git a/sync/test/engine/mock_update_handler.h b/sync/test/engine/mock_update_handler.h
index 8d11f96..0cbeca3 100644
--- a/sync/test/engine/mock_update_handler.h
+++ b/sync/test/engine/mock_update_handler.h
@@ -20,8 +20,11 @@ class MockUpdateHandler : public UpdateHandler {
// UpdateHandler implementation.
virtual void GetDownloadProgress(
sync_pb::DataTypeProgressMarker* progress_marker) const OVERRIDE;
+ virtual void GetDataTypeContext(sync_pb::DataTypeContext* context) const
+ OVERRIDE;
virtual void ProcessGetUpdatesResponse(
const sync_pb::DataTypeProgressMarker& progress_marker,
+ const sync_pb::DataTypeContext& mutated_context,
const SyncEntityList& applicable_updates,
sessions::StatusController* status) OVERRIDE;
virtual void ApplyUpdates(sessions::StatusController* status) OVERRIDE;