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

Unified Diff: chrome/browser/sync/glue/sync_backend_host.cc

Issue 10911084: Implement Invalidator::Acknowledge (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restart test + more cleanup Created 8 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
Index: chrome/browser/sync/glue/sync_backend_host.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index e64b8b04727d4e477368095cd6fae8192521c460..98c7f8c5029effc1cca155f9d493d53a5facc8b1 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -149,6 +149,11 @@ class SyncBackendHost::Core
// SyncBackendHost::UpdateRegisteredInvalidationIds.
void DoUpdateRegisteredInvalidationIds(const syncer::ObjectIdSet& ids);
+ // Called to acknowledge an invalidation on behalf of
+ // SyncBackendHost::AcknowledgeInvalidation.
+ void DoAcknowledgeInvalidation(const invalidation::ObjectId& id,
+ const syncer::AckHandle& ack_handle);
+
// Called to tell the syncapi to start syncing (generally after
// initialization and authentication).
void DoStartSyncing(const syncer::ModelSafeRoutingInfo& routing_info);
@@ -450,6 +455,15 @@ void SyncBackendHost::UpdateRegisteredInvalidationIds(
core_.get(), ids));
}
+void SyncBackendHost::AcknowledgeInvalidation(
+ const invalidation::ObjectId& id, const syncer::AckHandle& ack_handle) {
+ DCHECK_EQ(MessageLoop::current(), frontend_loop_);
+ DCHECK(sync_thread_.IsRunning());
+ sync_thread_.message_loop()->PostTask(FROM_HERE,
+ base::Bind(&SyncBackendHost::Core::DoAcknowledgeInvalidation,
+ core_.get(), id, ack_handle));
+}
+
void SyncBackendHost::StartSyncingWithServer() {
SDVLOG(1) << "SyncBackendHost::StartSyncingWithServer called.";
@@ -1129,6 +1143,19 @@ void SyncBackendHost::Core::DoUpdateRegisteredInvalidationIds(
}
}
+void SyncBackendHost::Core::DoAcknowledgeInvalidation(
+ const invalidation::ObjectId& id, const syncer::AckHandle& ack_handle) {
+ DCHECK_EQ(MessageLoop::current(), sync_loop_);
+ // |sync_manager_| may end up being NULL here in tests (in
+ // synchronous initialization mode) since this is called during
+ // shutdown.
+ //
+ // TODO(akalin): Fix this behavior (see http://crbug.com/140354).
+ if (sync_manager_.get()) {
+ sync_manager_->AcknowledgeInvalidation(id, ack_handle);
+ }
+}
+
void SyncBackendHost::Core::DoStartSyncing(
const syncer::ModelSafeRoutingInfo& routing_info) {
DCHECK_EQ(MessageLoop::current(), sync_loop_);

Powered by Google App Engine
This is Rietveld 408576698