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

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 10911084: Implement Invalidator::Acknowledge (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adapt patch to new TickClock interface Created 7 years, 10 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 | « chrome/browser/sync/profile_sync_service.h ('k') | chrome/browser/sync/profile_sync_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 5c17fb0f3e3c01b4bd833b558a4d80e13bc5a721..c8258ae0b9a2770f0dde039f834aee5b7d342694 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -497,6 +497,11 @@ void ProfileSyncService::StartUp() {
if (backend_.get()) {
backend_->UpdateRegisteredInvalidationIds(
invalidator_registrar_->GetAllRegisteredIds());
+ for (AckHandleReplayQueue::const_iterator it = ack_replay_queue_.begin();
+ it != ack_replay_queue_.end(); ++it) {
+ backend_->AcknowledgeInvalidation(it->first, it->second);
+ }
+ ack_replay_queue_.clear();
}
if (!sync_global_error_.get()) {
@@ -532,6 +537,18 @@ void ProfileSyncService::UnregisterInvalidationHandler(
invalidator_registrar_->UnregisterHandler(handler);
}
+void ProfileSyncService::AcknowledgeInvalidation(
+ const invalidation::ObjectId& id,
+ const syncer::AckHandle& ack_handle) {
+ if (backend_.get()) {
+ backend_->AcknowledgeInvalidation(id, ack_handle);
+ } else {
+ // If |backend_| is NULL, save the acknowledgements to replay when
+ // it's created and initialized.
+ ack_replay_queue_.push_back(std::make_pair(id, ack_handle));
+ }
+}
+
syncer::InvalidatorState ProfileSyncService::GetInvalidatorState() const {
return invalidator_registrar_->GetInvalidatorState();
}
« no previous file with comments | « chrome/browser/sync/profile_sync_service.h ('k') | chrome/browser/sync/profile_sync_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698