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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc

Issue 2259523003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc b/chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc
index 2a16a7130e4cd783550faf3b84da86c5e17522d4..a233d6b46441f625fd052003ef14727258acf5de 100644
--- a/chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc
@@ -381,7 +381,7 @@ void DownloadMetadataManager::SetRequest(content::DownloadItem* item,
GetDownloadManagerForBrowserContext(item->GetBrowserContext());
DCHECK_EQ(contexts_.count(download_manager), 1U);
contexts_[download_manager]->SetRequest(
- item, base::WrapUnique(new ClientDownloadRequest(*request)));
+ item, base::MakeUnique<ClientDownloadRequest>(*request));
}
void DownloadMetadataManager::GetDownloadDetails(
@@ -493,11 +493,10 @@ void DownloadMetadataManager::ManagerContext::GetDownloadDetails(
if (state_ != LOAD_COMPLETE) {
get_details_callbacks_.push_back(callback);
} else {
- callback.Run(
- download_metadata_
- ? base::WrapUnique(new ClientIncidentReport_DownloadDetails(
- download_metadata_->download()))
- : nullptr);
+ callback.Run(download_metadata_
+ ? base::MakeUnique<ClientIncidentReport_DownloadDetails>(
+ download_metadata_->download())
+ : nullptr);
}
}
@@ -604,11 +603,10 @@ void DownloadMetadataManager::ManagerContext::ClearPendingItems() {
void DownloadMetadataManager::ManagerContext::RunCallbacks() {
while (!get_details_callbacks_.empty()) {
const auto& callback = get_details_callbacks_.front();
- callback.Run(
- download_metadata_
- ? base::WrapUnique(new ClientIncidentReport_DownloadDetails(
- download_metadata_->download()))
- : nullptr);
+ callback.Run(download_metadata_
+ ? base::MakeUnique<ClientIncidentReport_DownloadDetails>(
+ download_metadata_->download())
+ : nullptr);
get_details_callbacks_.pop_front();
}
}

Powered by Google App Engine
This is Rietveld 408576698