| 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 6292aa8cc7b24ddb6fc7fe430d8529531f288589..d5f1081fdb8bdaef03986e828911a138999bb52d 100644
|
| --- a/components/offline_pages/background/request_coordinator.cc
|
| +++ b/components/offline_pages/background/request_coordinator.cc
|
| @@ -9,6 +9,7 @@
|
| #include "base/bind.h"
|
| #include "base/callback.h"
|
| #include "base/logging.h"
|
| +#include "base/metrics/histogram_macros.h"
|
| #include "base/time/time.h"
|
| #include "components/offline_pages/background/offliner_factory.h"
|
| #include "components/offline_pages/background/offliner_policy.h"
|
| @@ -19,6 +20,15 @@
|
| namespace offline_pages {
|
|
|
| namespace {
|
| +
|
| +// Records the final request status UMA for an offlining request. This should
|
| +// only be called once per Offliner::LoadAndSave request.
|
| +void RecordOfflinerResultUMA(Offliner::RequestStatus request_status) {
|
| + UMA_HISTOGRAM_ENUMERATION("OfflinePages.Background.OfflinerRequestStatus",
|
| + request_status,
|
| + Offliner::RequestStatus::STATUS_COUNT);
|
| +}
|
| +
|
| // TODO(dougarnett/petewil): Move to Policy object. Also consider lower minimum
|
| // battery percentage once there is some processing time limits in place.
|
| const Scheduler::TriggerConditions kUserRequestTriggerConditions(
|
| @@ -89,8 +99,11 @@ void RequestCoordinator::UpdateRequestCallback(
|
|
|
| void RequestCoordinator::StopProcessing() {
|
| is_canceled_ = true;
|
| - if (offliner_ && is_busy_)
|
| + if (offliner_ && is_busy_) {
|
| offliner_->Cancel();
|
| + RecordOfflinerResultUMA(
|
| + Offliner::RequestStatus::REQUEST_COORDINATOR_CANCELED);
|
| + }
|
|
|
| // Let the scheduler know we are done processing.
|
| scheduler_callback_.Run(true);
|
| @@ -171,6 +184,7 @@ void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request,
|
| request.client_id().name_space,
|
| "Saved",
|
| request.request_id());
|
| + RecordOfflinerResultUMA(status);
|
| last_offlining_status_ = status;
|
| watchdog_timer_.Stop();
|
|
|
|
|