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

Unified Diff: sync/notifier/invalidation_util.cc

Issue 23754021: Invalidation trickles mega-patch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months 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/notifier/invalidation_util.h ('k') | sync/notifier/invalidator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/invalidation_util.cc
diff --git a/sync/notifier/invalidation_util.cc b/sync/notifier/invalidation_util.cc
index 7cc80d299ba2ab9e21e9777eabcb80f8a9c57772..be254fc31770f51db7ddb144f30847feb35fc5e2 100644
--- a/sync/notifier/invalidation_util.cc
+++ b/sync/notifier/invalidation_util.cc
@@ -27,6 +27,25 @@ bool ObjectIdLessThan::operator()(const invalidation::ObjectId& lhs,
(lhs.source() == rhs.source() && lhs.name() < rhs.name());
}
+bool InvalidationVersionLessThan::operator()(
+ const syncer::Invalidation& a,
+ const syncer::Invalidation& b) const {
+ DCHECK(a.GetObjectId() == b.GetObjectId())
+ << "a: " << ObjectIdToString(a.GetObjectId()) << ", "
+ << "b: " << ObjectIdToString(a.GetObjectId());
+
+ if (a.IsUnknownVersion() && !b.IsUnknownVersion())
+ return true;
+
+ if (!a.IsUnknownVersion() && b.IsUnknownVersion())
+ return false;
+
+ if (a.IsUnknownVersion() && b.IsUnknownVersion())
+ return false;
+
+ return a.GetVersion() < b.GetVersion();
+}
+
bool RealModelTypeToObjectId(ModelType model_type,
invalidation::ObjectId* object_id) {
std::string notification_type;
« no previous file with comments | « sync/notifier/invalidation_util.h ('k') | sync/notifier/invalidator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698