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_); |