summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/public
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-17 07:01:11 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-17 07:01:11 +0000
commit55d56cf76e7070bfaaf8f795b8c35e9befdf2372 (patch)
treef938933da60c9c5f387dcdd5e8c0581a15db1670 /sync/internal_api/public
parent1fc99a487f94fc6fcfdbc9d5cdd1d3e77b7336fa (diff)
downloadchromium_src-55d56cf76e7070bfaaf8f795b8c35e9befdf2372.zip
chromium_src-55d56cf76e7070bfaaf8f795b8c35e9befdf2372.tar.gz
chromium_src-55d56cf76e7070bfaaf8f795b8c35e9befdf2372.tar.bz2
sync: Use invalidation local acknowledgements
As of r237421, the invalidations system now supports a new and improved form of local acknowledgements. Any invalidations not explicitly dropped or acknowledged will be redelivered after a restart. This CL makes use of the new functionality in sync. It uses the DataTypeTrackers to track the status of pending invalidations and acknowledge or drop invalidations as appropriate. Also notable in this CL is that the 'server_dropped_hints' flag has now been uncommented in the sync protocol. We've known for a long time that we wanted to support such a flag, but haven't been able to implement it correctly until now. BUG=78462,233437 Review URL: https://codereview.chromium.org/102353005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241170 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/public')
-rw-r--r--sync/internal_api/public/base/model_type_test_util.cc13
-rw-r--r--sync/internal_api/public/base/model_type_test_util.h7
2 files changed, 17 insertions, 3 deletions
diff --git a/sync/internal_api/public/base/model_type_test_util.cc b/sync/internal_api/public/base/model_type_test_util.cc
index d9621bb..4876962 100644
--- a/sync/internal_api/public/base/model_type_test_util.cc
+++ b/sync/internal_api/public/base/model_type_test_util.cc
@@ -7,15 +7,22 @@
namespace syncer {
-ObjectIdInvalidationMap BuildInvalidationMap(
+syncer::Invalidation BuildInvalidation(
ModelType type,
int version,
const std::string& payload) {
- ObjectIdInvalidationMap map;
invalidation::ObjectId id;
bool result = RealModelTypeToObjectId(type, &id);
DCHECK(result);
- map.Insert(Invalidation::Init(id, version, payload));
+ return Invalidation::Init(id, version, payload);
+}
+
+ObjectIdInvalidationMap BuildInvalidationMap(
+ ModelType type,
+ int version,
+ const std::string& payload) {
+ ObjectIdInvalidationMap map;
+ map.Insert(BuildInvalidation(type, version, payload));
return map;
}
diff --git a/sync/internal_api/public/base/model_type_test_util.h b/sync/internal_api/public/base/model_type_test_util.h
index c724bf5..1412f66 100644
--- a/sync/internal_api/public/base/model_type_test_util.h
+++ b/sync/internal_api/public/base/model_type_test_util.h
@@ -21,6 +21,13 @@ ObjectIdInvalidationMap BuildInvalidationMap(
int version,
const std::string& payload);
+// Builds an invalidation. Similar to Invalidation::Init, but its first
+// parameter is a ModelType rather than an ObjectId.
+syncer::Invalidation BuildInvalidation(
+ ModelType type,
+ int version,
+ const std::string& payload);
+
// Defined for googletest. Forwards to ModelTypeSetToString().
void PrintTo(ModelTypeSet model_types, ::std::ostream* os);