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

Side by Side Diff: chrome/browser/download/download_status_updater.cc

Issue 2845293004: Switch SupportsUserData uses to use unique_ptr. (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/download/download_status_updater.h" 5 #include "chrome/browser/download/download_status_updater.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 21 matching lines...) Expand all
32 public: 32 public:
33 static bool Get(content::DownloadItem* item) { 33 static bool Get(content::DownloadItem* item) {
34 return item->GetUserData(kKey) != NULL; 34 return item->GetUserData(kKey) != NULL;
35 } 35 }
36 36
37 static void Clear(content::DownloadItem* item) { 37 static void Clear(content::DownloadItem* item) {
38 item->RemoveUserData(kKey); 38 item->RemoveUserData(kKey);
39 } 39 }
40 40
41 explicit WasInProgressData(content::DownloadItem* item) { 41 explicit WasInProgressData(content::DownloadItem* item) {
42 item->SetUserData(kKey, this); 42 item->SetUserData(kKey, base::WrapUnique(this));
43 } 43 }
44 44
45 private: 45 private:
46 static const char kKey[]; 46 static const char kKey[];
47 DISALLOW_COPY_AND_ASSIGN(WasInProgressData); 47 DISALLOW_COPY_AND_ASSIGN(WasInProgressData);
48 }; 48 };
49 49
50 const char WasInProgressData::kKey[] = 50 const char WasInProgressData::kKey[] =
51 "DownloadItem DownloadStatusUpdater WasInProgressData"; 51 "DownloadItem DownloadStatusUpdater WasInProgressData";
52 52
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 float progress = 0; 142 float progress = 0;
143 int download_count = 0; 143 int download_count = 0;
144 GetProgress(&progress, &download_count); 144 GetProgress(&progress, &download_count);
145 linux_ui->SetDownloadCount(download_count); 145 linux_ui->SetDownloadCount(download_count);
146 linux_ui->SetProgressFraction(progress); 146 linux_ui->SetProgressFraction(progress);
147 } 147 }
148 #endif 148 #endif
149 // TODO(avi): Implement for Android? 149 // TODO(avi): Implement for Android?
150 } 150 }
151 #endif 151 #endif
OLDNEW
« no previous file with comments | « chrome/browser/download/download_path_reservation_tracker.cc ('k') | chrome/browser/download/download_status_updater_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698