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

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: 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/glue/sync_backend_host.h ('k') | chrome/browser/sync/invalidation_frontend.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 158ae2e9866d65ce793df94a66f2025f37103c37..880e285d0ac2d89dc55c665416dc54080c3ee3d8 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -153,6 +153,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);
@@ -477,6 +482,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.";
@@ -1238,6 +1252,18 @@ 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).
+ //
+ // 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_);
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host.h ('k') | chrome/browser/sync/invalidation_frontend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698