Commit 1b3ecdcb authored by Oleg Davydov's avatar Oleg Davydov Committed by Commit Bot

Remove |not_updated| from ExtensionDownloader::HandleManifestResults

Years ago there was a variable |not_updated| in

handle successfully/unsuccessfully downloaded extension manifests. Now
it is handled more elegant via ExtensionDownloader::DetermineUpdates
method, so we may remove it and replace its only usage with actual data.

ExtensionDownloader: :HandleManifestResults method, and it was used to
Change-Id: I188b588c061dd6595c2bb5d6030afe5200b28130
Reviewed-on: https://chromium-review.googlesource.com/c/1486271Reviewed-by: default avatarVladislav Kuzkokov <vkuzkokov@chromium.org>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Oleg Davydov <burunduk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635442}
parent 62012a47
......@@ -653,14 +653,11 @@ void ExtensionDownloader::HandleManifestResults(
std::unique_ptr<ManifestFetchData> fetch_data,
std::unique_ptr<UpdateManifestResults> results,
const base::Optional<std::string>& error) {
// Keep a list of extensions that will not be updated, so that the |delegate_|
// can be notified once we're done here.
std::set<std::string> not_updated(fetch_data->extension_ids());
if (!results) {
VLOG(2) << "parsing manifest failed (" << fetch_data->full_url() << ")";
NotifyExtensionsDownloadFailed(
not_updated, fetch_data->request_ids(),
fetch_data->extension_ids(), fetch_data->request_ids(),
ExtensionDownloaderDelegate::MANIFEST_INVALID);
return;
} else {
......@@ -1077,8 +1074,8 @@ void ExtensionDownloader::OnExtensionLoadComplete(base::FilePath crx_path) {
}
void ExtensionDownloader::NotifyExtensionsDownloadFailed(
const std::set<std::string>& extension_ids,
const std::set<int>& request_ids,
std::set<std::string> extension_ids,
std::set<int> request_ids,
ExtensionDownloaderDelegate::Error error) {
for (auto it = extension_ids.cbegin(); it != extension_ids.cend(); ++it) {
const ExtensionDownloaderDelegate::PingResult& ping = ping_results_[*it];
......
......@@ -284,9 +284,11 @@ class ExtensionDownloader {
void OnExtensionLoadComplete(base::FilePath crx_path);
// Invokes OnExtensionDownloadFailed() on the |delegate_| for each extension
// in the set, with |error| as the reason for failure.
void NotifyExtensionsDownloadFailed(const std::set<std::string>& id_set,
const std::set<int>& request_ids,
// in the set, with |error| as the reason for failure. Make a copy of
// arguments because there is no guarantee that callback won't indirectly
// change source of IDs.
void NotifyExtensionsDownloadFailed(std::set<std::string> id_set,
std::set<int> request_ids,
ExtensionDownloaderDelegate::Error error);
// Send a notification that an update was found for |id| that we'll
......
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