Commit e7f7493d authored by Pavol Marko's avatar Pavol Marko Committed by Commit Bot

cert_provisioning: Display failed processes as Failed in the UI

The UI was mistakenly displayed FailedWorkerInfo::state in the UI, which
is the state prior to failure, so it will never say Failed.

Clarify the meaning of the field by renaming/comments and always display
failed for failed workers.

In a follow-up, the status text will be changed to Failed (was <other
status>) or similar. This is not done in this CL in case we want to
merge it back, which does not allow UI string changes.

Bug: 1098244
Change-Id: Ib7c2a8308211bb4459640a99dd44e7c5c06dc23f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2276420Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarDenis Kuznetsov [CET] <antrim@chromium.org>
Reviewed-by: default avatarMichael Ershov <miersh@google.com>
Commit-Queue: Pavol Marko <pmarko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784836}
parent f4cba574
...@@ -620,7 +620,7 @@ void CertProvisioningScheduler::UpdateFailedCertProfiles( ...@@ -620,7 +620,7 @@ void CertProvisioningScheduler::UpdateFailedCertProfiles(
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
FailedWorkerInfo info; FailedWorkerInfo info;
info.state = worker.GetPreviousState(); info.state_before_failure = worker.GetPreviousState();
info.public_key = worker.GetPublicKey(); info.public_key = worker.GetPublicKey();
info.last_update_time = worker.GetLastUpdateTime(); info.last_update_time = worker.GetLastUpdateTime();
......
...@@ -42,9 +42,17 @@ using WorkerMap = ...@@ -42,9 +42,17 @@ using WorkerMap =
using CertProfileSet = base::flat_set<CertProfile, CertProfileComparator>; using CertProfileSet = base::flat_set<CertProfile, CertProfileComparator>;
// Holds information about a worker which failed that is still useful (e.g. for
// UI) after the worker has been destroyed.
struct FailedWorkerInfo { struct FailedWorkerInfo {
CertProvisioningWorkerState state = CertProvisioningWorkerState::kInitState; // The state the worker had prior to switching to the failed state
// (CertProvisioningWorkerState::kFailed).
CertProvisioningWorkerState state_before_failure =
CertProvisioningWorkerState::kInitState;
// The DER-encoded X.509 SPKI.
std::string public_key; std::string public_key;
// The time the worker was last updated, i.e. when it transferred to the
// failed state.
base::Time last_update_time; base::Time last_update_time;
}; };
......
...@@ -126,8 +126,9 @@ void CollectProvisioningProcesses( ...@@ -126,8 +126,9 @@ void CollectProvisioningProcesses(
const chromeos::cert_provisioning::FailedWorkerInfo& worker = const chromeos::cert_provisioning::FailedWorkerInfo& worker =
failed_worker_entry.second; failed_worker_entry.second;
list_to_append_to->Append(CreateProvisioningProcessEntry( list_to_append_to->Append(CreateProvisioningProcessEntry(
failed_worker_entry.first, is_device_wide, worker.state, failed_worker_entry.first, is_device_wide,
worker.last_update_time, worker.public_key)); CertProvisioningWorkerState::kFailed, worker.last_update_time,
worker.public_key));
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment