Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1279)

Unified Diff: extensions/browser/updater/extension_downloader.cc

Issue 2294653002: Some linked_ptr -> unique_ptr conversion in extensions/browser. (Closed)
Patch Set: address comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/updater/extension_downloader.h ('k') | extensions/browser/updater/request_queue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/updater/extension_downloader.cc
diff --git a/extensions/browser/updater/extension_downloader.cc b/extensions/browser/updater/extension_downloader.cc
index 91c08c29e28972c55f7d8d82d540d3869fa3682f..7bc7f6752a6c14ca4ec8383a42964adfee75b6e2 100644
--- a/extensions/browser/updater/extension_downloader.cc
+++ b/extensions/browser/updater/extension_downloader.cc
@@ -252,10 +252,9 @@ void ExtensionDownloader::DoStartAllPending() {
for (FetchMap::iterator it = fetches_preparing_.begin();
it != fetches_preparing_.end();
++it) {
- std::vector<linked_ptr<ManifestFetchData>>& list = it->second;
- for (size_t i = 0; i < list.size(); ++i) {
- StartUpdateCheck(std::unique_ptr<ManifestFetchData>(list[i].release()));
- }
+ std::vector<std::unique_ptr<ManifestFetchData>>& list = it->second;
+ for (size_t i = 0; i < list.size(); ++i)
+ StartUpdateCheck(std::move(list[i]));
}
fetches_preparing_.clear();
}
@@ -371,11 +370,13 @@ bool ExtensionDownloader::AddExtensionData(const std::string& id,
if (!added) {
// Otherwise add a new element to the list, if the list doesn't exist or
// if its last element is already full.
- linked_ptr<ManifestFetchData> fetch(
+ std::unique_ptr<ManifestFetchData> fetch(
CreateManifestFetchData(update_url, request_id));
- fetches_preparing_[std::make_pair(request_id, update_url)].push_back(fetch);
- added = fetch->AddExtension(id, version.GetString(), optional_ping_data,
- update_url_data, install_source);
+ ManifestFetchData* fetch_ptr = fetch.get();
+ fetches_preparing_[std::make_pair(request_id, update_url)].push_back(
+ std::move(fetch));
+ added = fetch_ptr->AddExtension(id, version.GetString(), optional_ping_data,
+ update_url_data, install_source);
DCHECK(added);
}
« no previous file with comments | « extensions/browser/updater/extension_downloader.h ('k') | extensions/browser/updater/request_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698