Chromium Code Reviews| Index: chrome/browser/extensions/updater/extension_updater.cc |
| diff --git a/chrome/browser/extensions/updater/extension_updater.cc b/chrome/browser/extensions/updater/extension_updater.cc |
| index 0ebc97b76bb16aba590e4d7a920fca3945e86170..866d31a2a5a28c1690e5bfc6a89e8fddf2c9c02b 100644 |
| --- a/chrome/browser/extensions/updater/extension_updater.cc |
| +++ b/chrome/browser/extensions/updater/extension_updater.cc |
| @@ -263,7 +263,7 @@ void ExtensionUpdater::DoCheckSoon() { |
| } |
| void ExtensionUpdater::AddToDownloader(const ExtensionSet* extensions, |
| - const std::set<std::string>& pending_ids) { |
| + const std::list<std::string>& pending_ids) { |
| for (ExtensionSet::const_iterator iter = extensions->begin(); |
|
Aaron Boodman
2012/04/09 17:02:14
Name this iterator extension_iter and the one belo
mitchellwrosen
2012/04/13 22:20:18
Done.
|
| iter != extensions->end(); ++iter) { |
| const Extension& extension = **iter; |
| @@ -274,9 +274,13 @@ void ExtensionUpdater::AddToDownloader(const ExtensionSet* extensions, |
| // An extension might be overwritten by policy, and have its update url |
| // changed. Make sure existing extensions aren't fetched again, if a |
| // pending fetch for an extension with the same id already exists. |
| - if (!ContainsKey(pending_ids, extension.id())) { |
| + std::list<std::string>::const_iterator iter2 = std::find( |
| + pending_ids.begin(), |
| + pending_ids.end(), |
| + extension.id()); |
| + if (iter2 == pending_ids.end()) { |
| if (downloader_->AddExtension(extension)) |
| - in_progress_ids_.insert(extension.id()); |
| + in_progress_ids_.push_back(extension.id()); |
| } |
| } |
| } |
| @@ -297,22 +301,22 @@ void ExtensionUpdater::CheckNow() { |
| const PendingExtensionManager* pending_extension_manager = |
| service_->pending_extension_manager(); |
| - std::set<std::string> pending_ids; |
| + std::list<std::string> pending_ids; |
| pending_extension_manager->GetPendingIdsForUpdateCheck(&pending_ids); |
| - std::set<std::string>::const_iterator iter; |
| + std::list<std::string>::const_iterator iter; |
| for (iter = pending_ids.begin(); iter != pending_ids.end(); ++iter) { |
| - PendingExtensionInfo info; |
| - bool found_id = pending_extension_manager->GetById(*iter, &info); |
| - DCHECK(found_id); |
| - if (!found_id) |
| + const PendingExtensionInfo* info = pending_extension_manager->GetById( |
| + *iter); |
| + DCHECK(pending_extension_manager); |
|
Aaron Boodman
2012/04/09 17:02:14
I think you meant to DCHECK(info) here. Same with
mitchellwrosen
2012/04/13 22:20:18
Done.
|
| + if (!pending_extension_manager) |
| continue; |
| - if (!Extension::IsAutoUpdateableLocation(info.install_source())) { |
| + if (!Extension::IsAutoUpdateableLocation(info->install_source())) { |
| VLOG(2) << "Extension " << *iter << " is not auto updateable"; |
| continue; |
| } |
| - if (downloader_->AddPendingExtension(*iter, info.update_url())) |
| - in_progress_ids_.insert(*iter); |
| + if (downloader_->AddPendingExtension(*iter, info->update_url())) |
| + in_progress_ids_.push_back(*iter); |
| } |
| AddToDownloader(service_->extensions(), pending_ids); |
| @@ -339,7 +343,7 @@ void ExtensionUpdater::OnExtensionDownloadFailed(const std::string& id, |
| const PingResult& ping) { |
| DCHECK(alive_); |
| UpdatePingData(id, ping); |
| - in_progress_ids_.erase(id); |
| + in_progress_ids_.remove(id); |
| NotifyIfFinished(); |
| } |
| @@ -368,7 +372,7 @@ void ExtensionUpdater::OnBlacklistDownloadFinished( |
| const PingResult& ping) { |
| DCHECK(alive_); |
| UpdatePingData(ExtensionDownloader::kBlacklistAppID, ping); |
| - in_progress_ids_.erase(ExtensionDownloader::kBlacklistAppID); |
| + in_progress_ids_.remove(ExtensionDownloader::kBlacklistAppID); |
| NotifyIfFinished(); |
| // Verify sha256 hash value. |
| @@ -468,7 +472,7 @@ void ExtensionUpdater::MaybeInstallCRXFile() { |
| chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
| content::Source<CrxInstaller>(installer)); |
| } |
| - in_progress_ids_.erase(crx_file.id); |
| + in_progress_ids_.remove(crx_file.id); |
| fetched_crx_files_.pop(); |
| } |