| Index: components/offline_pages/background/request_coordinator_event_logger.cc
|
| diff --git a/components/offline_pages/background/request_coordinator_event_logger.cc b/components/offline_pages/background/request_coordinator_event_logger.cc
|
| index 08702920a734dcb463a7c53df1d9a3cf38145bbb..51b3bbcff1452bbce37e831faee5d0734ab95ecc 100644
|
| --- a/components/offline_pages/background/request_coordinator_event_logger.cc
|
| +++ b/components/offline_pages/background/request_coordinator_event_logger.cc
|
| @@ -28,8 +28,35 @@ static std::string OfflinerRequestStatusToString(
|
| case Offliner::FOREGROUND_CANCELED:
|
| return "FOREGROUND_CANCELED";
|
| default:
|
| - DCHECK(false);
|
| - return "";
|
| + NOTREACHED();
|
| + return std::to_string(static_cast<int>(request_status));
|
| + }
|
| +}
|
| +
|
| +static std::string BackgroundSavePageResultToString(
|
| + RequestNotifier::BackgroundSavePageResult result) {
|
| + switch (result) {
|
| + case RequestNotifier::BackgroundSavePageResult::SUCCESS:
|
| + return "SUCCESS";
|
| + case RequestNotifier::BackgroundSavePageResult::PRERENDER_FAILURE:
|
| + return "PRERENDER_FAILURE";
|
| + case RequestNotifier::BackgroundSavePageResult::PRERENDER_CANCELED:
|
| + return "PRERENDER_CANCELED";
|
| + case RequestNotifier::BackgroundSavePageResult::FOREGROUND_CANCELED:
|
| + return "FOREGROUND_CANCELED";
|
| + case RequestNotifier::BackgroundSavePageResult::SAVE_FAILED:
|
| + return "SAVE_FAILED";
|
| + case RequestNotifier::BackgroundSavePageResult::EXPIRED:
|
| + return "EXPIRED";
|
| + case RequestNotifier::BackgroundSavePageResult::RETRY_COUNT_EXCEEDED:
|
| + return "RETRY_COUNT_EXCEEDED";
|
| + case RequestNotifier::BackgroundSavePageResult::START_COUNT_EXCEEDED:
|
| + return "START_COUNT_EXCEEDED";
|
| + case RequestNotifier::BackgroundSavePageResult::REMOVED:
|
| + return "REMOVED";
|
| + default:
|
| + NOTREACHED();
|
| + return std::to_string(static_cast<int>(result));
|
| }
|
| }
|
|
|
| @@ -43,28 +70,36 @@ static std::string UpdateRequestResultToString(
|
| case RequestQueue::UpdateRequestResult::REQUEST_DOES_NOT_EXIST:
|
| return "REQUEST_DOES_NOT_EXIST";
|
| default:
|
| - DCHECK(false);
|
| - return "";
|
| + NOTREACHED();
|
| + return std::to_string(static_cast<int>(result));
|
| }
|
| }
|
|
|
| } // namespace
|
|
|
| -void RequestCoordinatorEventLogger::RecordSavePageRequestUpdated(
|
| +void RequestCoordinatorEventLogger::RecordOfflinerResult(
|
| const std::string& name_space,
|
| Offliner::RequestStatus new_status,
|
| - int64_t id) {
|
| - RecordActivity("Save page request for ID: " + std::to_string(id) +
|
| - " and namespace: " + name_space +
|
| - " has been updated with status " +
|
| + int64_t request_id) {
|
| + RecordActivity("Background save attempt for " + name_space + ":" +
|
| + std::to_string(request_id) + " - " +
|
| OfflinerRequestStatusToString(new_status));
|
| }
|
|
|
| +void RequestCoordinatorEventLogger::RecordDroppedSavePageRequest(
|
| + const std::string& name_space,
|
| + RequestNotifier::BackgroundSavePageResult result,
|
| + int64_t request_id) {
|
| + RecordActivity("Background save request removed " + name_space + ":" +
|
| + std::to_string(request_id) + " - " +
|
| + BackgroundSavePageResultToString(result));
|
| +}
|
| +
|
| void RequestCoordinatorEventLogger::RecordUpdateRequestFailed(
|
| const std::string& name_space,
|
| RequestQueue::UpdateRequestResult result) {
|
| - RecordActivity("Updating queued request for namespace: " + name_space +
|
| - " failed with result: " + UpdateRequestResultToString(result));
|
| + RecordActivity("Updating queued request for " + name_space + " failed - " +
|
| + UpdateRequestResultToString(result));
|
| }
|
|
|
| } // namespace offline_pages
|
|
|