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

Unified Diff: content/browser/download/download_request_core.cc

Issue 2815913005: Switch to using scoped_ptr with UserData (Closed)
Patch Set: fixes 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: content/browser/download/download_request_core.cc
diff --git a/content/browser/download/download_request_core.cc b/content/browser/download/download_request_core.cc
index 7e8d102d55c6b7b99df107aa0e86eb7f542ffa76..b3c576278403fcdb1eebfe7c4ae42b3febf4ee8f 100644
--- a/content/browser/download/download_request_core.cc
+++ b/content/browser/download/download_request_core.cc
@@ -83,13 +83,13 @@ const int DownloadRequestData::kKey = 0;
void DownloadRequestData::Attach(net::URLRequest* request,
DownloadUrlParameters* parameters,
uint32_t download_id) {
- DownloadRequestData* request_data = new DownloadRequestData;
+ auto request_data = base::MakeUnique<DownloadRequestData>();
request_data->save_info_.reset(
new DownloadSaveInfo(parameters->GetSaveInfo()));
request_data->download_id_ = download_id;
request_data->transient_ = parameters->is_transient();
request_data->on_started_callback_ = parameters->callback();
- request->SetUserData(&kKey, request_data);
+ request->SetUserData(&kKey, std::move(request_data));
}
// static

Powered by Google App Engine
This is Rietveld 408576698