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

Unified Diff: sync/sessions/data_type_tracker.cc

Issue 23441042: Refactor common invalidation framework types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move DEPS rule Created 7 years, 2 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/sessions/data_type_tracker.h ('k') | sync/sessions/nudge_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/data_type_tracker.cc
diff --git a/sync/sessions/data_type_tracker.cc b/sync/sessions/data_type_tracker.cc
index a061679839f174b182925b7e1f22f2a24e44fe25..b0b464923ce049d70d1964c4cd3bf0bbe482177d 100644
--- a/sync/sessions/data_type_tracker.cc
+++ b/sync/sessions/data_type_tracker.cc
@@ -5,6 +5,8 @@
#include "sync/sessions/data_type_tracker.h"
#include "base/logging.h"
+#include "sync/internal_api/public/base/invalidation.h"
+#include "sync/notifier/single_object_invalidation_set.h"
#include "sync/sessions/nudge_tracker.h"
namespace syncer {
@@ -27,13 +29,20 @@ void DataTypeTracker::RecordLocalRefreshRequest() {
local_refresh_request_count_++;
}
-void DataTypeTracker::RecordRemoteInvalidation(
- const std::string& payload) {
- pending_payloads_.push_back(payload);
- if (pending_payloads_.size() > payload_buffer_size_) {
- // Drop the oldest payload if we've overflowed.
- pending_payloads_.pop_front();
- local_payload_overflow_ = true;
+void DataTypeTracker::RecordRemoteInvalidations(
+ const SingleObjectInvalidationSet& invalidations) {
+ for (SingleObjectInvalidationSet::const_iterator it =
+ invalidations.begin(); it != invalidations.end(); ++it) {
+ if (it->is_unknown_version()) {
+ server_payload_overflow_ = true;
+ } else {
+ pending_payloads_.push_back(it->payload());
+ if (pending_payloads_.size() > payload_buffer_size_) {
+ // Drop the oldest payload if we've overflowed.
+ pending_payloads_.pop_front();
+ local_payload_overflow_ = true;
+ }
+ }
}
}
« no previous file with comments | « sync/sessions/data_type_tracker.h ('k') | sync/sessions/nudge_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698