| 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 fe532322af75c6aea7dc3df2f12c52a8a799c09b..09d388ff2063b31f86581f4bb5ecf14aab194790 100644
|
| --- a/components/offline_pages/background/request_coordinator.cc
|
| +++ b/components/offline_pages/background/request_coordinator.cc
|
| @@ -23,7 +23,7 @@ RequestCoordinator::RequestCoordinator(std::unique_ptr<OfflinerPolicy> policy,
|
| factory_(std::move(factory)),
|
| queue_(std::move(queue)),
|
| scheduler_(std::move(scheduler)),
|
| - last_offlining_status_(Offliner::UNKNOWN) {
|
| + last_offlining_status_(Offliner::RequestStatus::UNKNOWN) {
|
| DCHECK(policy_ != nullptr);
|
| }
|
|
|
| @@ -45,7 +45,7 @@ bool RequestCoordinator::SavePageLater(
|
| queue_->AddRequest(request,
|
| base::Bind(&RequestCoordinator::AddRequestResultCallback,
|
| AsWeakPtr()));
|
| - // TODO: Do I need to persist the request in case the add fails?
|
| + // TODO(petewil): Do I need to persist the request in case the add fails?
|
|
|
| // TODO(petewil): Eventually we will wait for the StartProcessing callback,
|
| // but for now just kick start the request so we can test the wiring.
|
| @@ -73,25 +73,26 @@ bool RequestCoordinator::StartProcessing(
|
| void RequestCoordinator::StopProcessing() {
|
| }
|
|
|
| -void RequestCoordinator::SendRequestToOffliner(SavePageRequest& request) {
|
| +void RequestCoordinator::SendRequestToOffliner(const SavePageRequest& request) {
|
| // TODO(petewil): When we have multiple offliners, we need to pick one.
|
| Offliner* offliner = factory_->GetOffliner(policy_.get());
|
| if (!offliner) {
|
| - LOG(ERROR) << "Unable to create Prerendering Offliner. "
|
| - << "Cannot background offline page.";
|
| + DVLOG(0) << "Unable to create Offliner. "
|
| + << "Cannot background offline page.";
|
| return;
|
| }
|
|
|
| - // Start the load and save process in the prerenderer (Async).
|
| + // Start the load and save process in the offliner (Async).
|
| offliner->LoadAndSave(
|
| request,
|
| base::Bind(&RequestCoordinator::OfflinerDoneCallback, AsWeakPtr()));
|
| }
|
|
|
| -void RequestCoordinator::OfflinerDoneCallback(
|
| - const SavePageRequest& request,
|
| - Offliner::CompletionStatus status) {
|
| - DVLOG(2) << "prerenderer finished, status " << status << ", " << __FUNCTION__;
|
| +void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request,
|
| + Offliner::RequestStatus status) {
|
| + DVLOG(2) << "offliner finished, saved: "
|
| + << (status == Offliner::RequestStatus::SAVED) << ", "
|
| + << __FUNCTION__;
|
| last_offlining_status_ = status;
|
| }
|
|
|
|
|