Chromium Code Reviews| 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 42468ab57e3fd3ad8437dd3d40e2301cf86f91ec..7a4852f0668ed43edc27be48911816639ebef7ae 100644 |
| --- a/chrome/browser/sync/profile_sync_service.cc |
| +++ b/chrome/browser/sync/profile_sync_service.cc |
| @@ -498,6 +498,11 @@ void ProfileSyncService::StartUp() { |
| if (backend_.get()) { |
| backend_->UpdateRegisteredInvalidationIds( |
| invalidator_registrar_->GetAllRegisteredIds()); |
| + for (AckHandleReplayQueue::const_iterator it = ack_replay_queue_.begin(); |
|
rlarocque
2013/02/12 21:48:04
I don't like the way this code (or the line above
dcheng
2013/02/12 22:39:28
I don't mind fixing this, but perhaps it would be
|
| + it != ack_replay_queue_.end(); ++it) { |
| + backend_->AcknowledgeInvalidation(it->first, it->second); |
| + } |
| + ack_replay_queue_.clear(); |
| } |
| if (!sync_global_error_.get()) { |
| @@ -533,6 +538,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(); |
| } |