| 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 f729bc51c35847bd78afb582e0817cc89fbc4f80..cc80a3424d2d6ade6e83c8a159104717fdc12ca0 100644
|
| --- a/components/offline_pages/core/background/request_coordinator.cc
|
| +++ b/components/offline_pages/core/background/request_coordinator.cc
|
| @@ -883,6 +883,8 @@ void RequestCoordinator::StartOffliner(
|
| if (offliner_->LoadAndSave(
|
| update_result->updated_items.at(0),
|
| base::Bind(&RequestCoordinator::OfflinerDoneCallback,
|
| + weak_ptr_factory_.GetWeakPtr()),
|
| + base::Bind(&RequestCoordinator::OfflinerProgressCallback,
|
| weak_ptr_factory_.GetWeakPtr()))) {
|
| base::TimeDelta timeout;
|
| if (processing_state_ == ProcessingWindowState::SCHEDULED_WINDOW) {
|
| @@ -934,6 +936,14 @@ void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request,
|
| scheduler_callback_.Run(true);
|
| }
|
|
|
| +void RequestCoordinator::OfflinerProgressCallback(
|
| + const SavePageRequest& request,
|
| + int64_t received_bytes) {
|
| + DVLOG(2) << "offliner progress, received bytes: " << received_bytes;
|
| + DCHECK(received_bytes >= 0);
|
| + NotifyNetworkProgress(request, received_bytes);
|
| +}
|
| +
|
| void RequestCoordinator::UpdateRequestForCompletedAttempt(
|
| const SavePageRequest& request,
|
| Offliner::RequestStatus status) {
|
| @@ -1066,6 +1076,12 @@ void RequestCoordinator::NotifyChanged(const SavePageRequest& request) {
|
| observer.OnChanged(request);
|
| }
|
|
|
| +void RequestCoordinator::NotifyNetworkProgress(const SavePageRequest& request,
|
| + int64_t received_bytes) {
|
| + for (Observer& observer : observers_)
|
| + observer.OnNetworkProgress(request, received_bytes);
|
| +}
|
| +
|
| ClientPolicyController* RequestCoordinator::GetPolicyController() {
|
| return policy_controller_.get();
|
| }
|
|
|