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

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

Issue 2847353002: Switch SupportsUserData uses to use unique_ptr. (Closed)
Patch Set: fix Created 3 years, 8 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 b57d1842a33347ff67bec90986f9dde0782e0256..1eb450a0f241b77439c154dd2a93f181b4ecbf54 100644
--- a/chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc
@@ -61,6 +61,8 @@ const base::FilePath::CharType kDownloadMetadataBasename[] =
// it is in progress.
class DownloadItemData : public base::SupportsUserData::Data {
public:
+ ~DownloadItemData() override {}
+
// Sets the ClientDownloadRequest for a given DownloadItem.
static void SetRequestForDownload(
content::DownloadItem* item,
@@ -76,7 +78,6 @@ class DownloadItemData : public base::SupportsUserData::Data {
explicit DownloadItemData(std::unique_ptr<ClientDownloadRequest> request)
: request_(std::move(request)) {}
- ~DownloadItemData() override {}
std::unique_ptr<ClientDownloadRequest> request_;
@@ -91,7 +92,8 @@ const void* const DownloadItemData::kKey_ = &DownloadItemData::kKey_;
void DownloadItemData::SetRequestForDownload(
content::DownloadItem* item,
std::unique_ptr<ClientDownloadRequest> request) {
- item->SetUserData(&kKey_, new DownloadItemData(std::move(request)));
+ item->SetUserData(&kKey_,
+ base::WrapUnique(new DownloadItemData(std::move(request))));
}
// static

Powered by Google App Engine
This is Rietveld 408576698