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 d1d380b005043d4a541073c48f6832a005653476..829fc85a3a68d28ba235b499e80cebe15fd99b48 100644 |
| --- a/components/offline_pages/background/request_coordinator.cc |
| +++ b/components/offline_pages/background/request_coordinator.cc |
| @@ -136,6 +136,7 @@ RequestCoordinator::RequestCoordinator( |
| network_quality_estimator_(network_quality_estimator), |
| active_request_(nullptr), |
| last_offlining_status_(Offliner::RequestStatus::UNKNOWN), |
| + scheduler_callback_(base::Bind(&EmptySchedulerCallback)), |
| immediate_schedule_callback_(base::Bind(&EmptySchedulerCallback)), |
| weak_ptr_factory_(this) { |
| DCHECK(policy_ != nullptr); |
| @@ -239,6 +240,7 @@ bool RequestCoordinator::CancelActiveRequestIfItMatches( |
| if (request_ids.end() != std::find(request_ids.begin(), request_ids.end(), |
| active_request_->request_id())) { |
| StopPrerendering(Offliner::RequestStatus::REQUEST_COORDINATOR_CANCELED); |
| + active_request_.reset(nullptr); |
| return true; |
| } |
| } |
| @@ -485,6 +487,7 @@ void RequestCoordinator::TryNextRequest() { |
| is_starting_ = false; |
| // Let the scheduler know we are done processing. |
| + // TODO: Make sure the scheduler callback is valid before running it. |
|
dougarnett
2016/10/21 16:46:02
wonder if we could base on processing_state != STO
|
| scheduler_callback_.Run(true); |
| return; |