Commit 75ce6af8 authored by Saurabh Nijhara's avatar Saurabh Nijhara Committed by Commit Bot

Modify PENDING_ADD_FAILED failure reason

As per the current code flow, PENDING_ADD_FAILED failure reason can
be reported when:
1) an extension with same extension_id is already installed from a
higher priority source (Manifest::Location) but is corrupted. This is
then not reported in the metrics as the extension is already installed.
2) extension is already in the pending extension list from a higher
priority source (Manifest::Location).

Case #2 should not be reported as PENDING_ADD_FAILED failure for the
force installed extension.

Bug: b:162855924
Change-Id: I1f91a6d5ae97c7f75fc69584d9ba0ed9516e6d79
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2379859Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Reviewed-by: default avatarOleg Davydov <burunduk@chromium.org>
Reviewed-by: default avatarSwapnil Gupta <swapnilgupta@google.com>
Commit-Queue: Saurabh Nijhara <snijhara@google.com>
Cr-Commit-Position: refs/heads/master@{#805666}
parent 0212d41e
......@@ -319,9 +319,14 @@ bool ExtensionService::OnExternalExtensionUpdateUrlFound(
info.extension_id, info.install_parameter, info.update_url,
info.download_location, info.creation_flags,
info.mark_acknowledged)) {
install_stage_tracker->ReportFailure(
info.extension_id,
InstallStageTracker::FailureReason::PENDING_ADD_FAILED);
// We can reach here if the extension from an equal or higher priority
// source is already present in the |pending_extension_list_|. No need to
// report the failure in this case.
if (!pending_extension_manager()->GetById(info.extension_id)) {
install_stage_tracker->ReportFailure(
info.extension_id,
InstallStageTracker::FailureReason::PENDING_ADD_FAILED);
}
return false;
}
......
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