Chromium Code Reviews| Index: components/offline_pages/background/request_coordinator.cc |
| diff --git a/components/offline_pages/background/request_coordinator.cc b/components/offline_pages/background/request_coordinator.cc |
| index c4d602e0aecdb5a67c671041ef82a39b9c130300..11f4725ad38e46cfe6f5b3ad10db64de8a9590c4 100644 |
| --- a/components/offline_pages/background/request_coordinator.cc |
| +++ b/components/offline_pages/background/request_coordinator.cc |
| @@ -638,12 +638,18 @@ void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request, |
| } |
| void RequestCoordinator::EnableForOffliner(int64_t request_id) { |
| - disabled_requests_.erase(request_id); |
| - // If we are not busy, start processing right away. |
| - StartProcessingIfConnected(); |
| + if (disabled_requests_.find(request_id) == disabled_requests_.end()) |
| + return; |
| + disabled_requests_.erase(request_id); |
| + // If we are not busy, start processing right away. |
| + StartProcessingIfConnected(); |
| } |
| void RequestCoordinator::MarkRequestCompleted(int64_t request_id) { |
| + if (disabled_requests_.find(request_id) == disabled_requests_.end()) |
|
Pete Williamson
2016/10/12 17:33:36
Ah, nice catch.
Dmitry Titov
2016/10/12 23:11:14
Acknowledged.
|
| + return; |
| + disabled_requests_.erase(request_id); |
| + |
| // Remove the request, but send out SUCCEEDED instead of removed. |
| std::vector<int64_t> request_ids { request_id }; |
| queue_->RemoveRequests( |