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

Unified Diff: chrome/browser/download/download_path_reservation_tracker.cc

Issue 2845293004: Switch SupportsUserData uses to use unique_ptr. (Closed)
Patch Set: 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
« no previous file with comments | « chrome/browser/download/download_item_model.cc ('k') | chrome/browser/download/download_status_updater.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_path_reservation_tracker.cc
diff --git a/chrome/browser/download/download_path_reservation_tracker.cc b/chrome/browser/download/download_path_reservation_tracker.cc
index 2c74a39535ba2687aeee037b35069a58c882a2b5..c3373d508677accb4bd48e121d1b6bdef53e1e7a 100644
--- a/chrome/browser/download/download_path_reservation_tracker.cc
+++ b/chrome/browser/download/download_path_reservation_tracker.cc
@@ -15,6 +15,7 @@
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/path_service.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
@@ -62,10 +63,9 @@ class DownloadItemObserver : public DownloadItem::Observer,
public base::SupportsUserData::Data {
public:
explicit DownloadItemObserver(DownloadItem* download_item);
-
- private:
~DownloadItemObserver() override;
+ private:
// DownloadItem::Observer
void OnDownloadUpdated(DownloadItem* download) override;
void OnDownloadDestroyed(DownloadItem* download) override;
@@ -338,7 +338,7 @@ DownloadItemObserver::DownloadItemObserver(DownloadItem* download_item)
last_target_path_(download_item->GetTargetFilePath()) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
download_item_->AddObserver(this);
- download_item_->SetUserData(&kUserDataKey, this);
+ download_item_->SetUserData(&kUserDataKey, base::WrapUnique(this));
}
DownloadItemObserver::~DownloadItemObserver() {
« no previous file with comments | « chrome/browser/download/download_item_model.cc ('k') | chrome/browser/download/download_status_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698