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

Unified Diff: chrome/browser/download/chrome_download_manager_delegate.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 | « no previous file | chrome/browser/download/download_danger_prompt_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/chrome_download_manager_delegate.cc
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
index f9b4e533b35e9ccf03fc79d18ea55d9b30a00978..c070dfe36c74236bee7bd5af92fb14c29501e7c6 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -11,6 +11,7 @@
#include "base/callback.h"
#include "base/files/file_util.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/rand_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -318,7 +319,7 @@ void ChromeDownloadManagerDelegate::DisableSafeBrowsing(DownloadItem* item) {
item->GetUserData(&kSafeBrowsingUserDataKey));
if (!state) {
state = new SafeBrowsingState();
- item->SetUserData(&kSafeBrowsingUserDataKey, state);
+ item->SetUserData(&kSafeBrowsingUserDataKey, base::WrapUnique(state));
}
state->CompleteDownload();
#endif
@@ -339,7 +340,7 @@ bool ChromeDownloadManagerDelegate::IsDownloadReadyForCompletion(
<< item->DebugString(false);
state = new SafeBrowsingState();
state->set_callback(internal_complete_callback);
- item->SetUserData(&kSafeBrowsingUserDataKey, state);
+ item->SetUserData(&kSafeBrowsingUserDataKey, base::WrapUnique(state));
service->CheckClientDownload(
item,
base::Bind(&ChromeDownloadManagerDelegate::CheckClientDownloadDone,
« no previous file with comments | « no previous file | chrome/browser/download/download_danger_prompt_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698