| Index: components/offline_pages/core/background/request_coordinator.cc
|
| diff --git a/components/offline_pages/core/background/request_coordinator.cc b/components/offline_pages/core/background/request_coordinator.cc
|
| index 346ec0294a13ff8f0f916bd92c041b163888769b..e25b4b09cbe6775adbbc9abb17dededdee596351 100644
|
| --- a/components/offline_pages/core/background/request_coordinator.cc
|
| +++ b/components/offline_pages/core/background/request_coordinator.cc
|
| @@ -184,7 +184,13 @@ RequestCoordinator::RequestCoordinator(
|
| std::unique_ptr<CleanupTaskFactory> cleanup_factory(
|
| new CleanupTaskFactory(policy_.get(), this, &event_logger_));
|
| queue_->SetCleanupFactory(std::move(cleanup_factory));
|
| - // Do a cleanup at startup time.
|
| + // If we exited with any items left in the OFFLINING state, move them back to
|
| + // the AVAILABLE state, and update the UI by sending notifications. Do this
|
| + // before we cleanup, so any requests that are now OFFLINING which have
|
| + // expired can be legitimate candidates for cleanup.
|
| + queue_->ReconcileRequests(base::Bind(&RequestCoordinator::ReconcileCallback,
|
| + weak_ptr_factory_.GetWeakPtr()));
|
| + // Do a cleanup of expired or over tried requests at startup time.
|
| queue_->CleanupRequestQueue();
|
| }
|
|
|
| @@ -466,6 +472,12 @@ void RequestCoordinator::UpdateMultipleRequestsCallback(
|
| StartImmediatelyIfConnected();
|
| }
|
|
|
| +void RequestCoordinator::ReconcileCallback(
|
| + std::unique_ptr<UpdateRequestsResult> result) {
|
| + for (const auto& request : result->updated_items)
|
| + NotifyChanged(request);
|
| +}
|
| +
|
| void RequestCoordinator::HandleRemovedRequestsAndCallback(
|
| const RemoveRequestsCallback& callback,
|
| RequestNotifier::BackgroundSavePageResult status,
|
|
|