diff options
author | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-08 18:27:29 +0000 |
---|---|---|
committer | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-08 18:27:29 +0000 |
commit | 41b0021c13870f41b76884abba7a2656ea661e48 (patch) | |
tree | 01b78efbfdb9b19580ebe4ecbbf776fa1d7ace0f /chrome/browser/download/download_shelf.cc | |
parent | c39df1a7114290fa7c6f2683f69d751a904f49cb (diff) | |
download | chromium_src-41b0021c13870f41b76884abba7a2656ea661e48.zip chromium_src-41b0021c13870f41b76884abba7a2656ea661e48.tar.gz chromium_src-41b0021c13870f41b76884abba7a2656ea661e48.tar.bz2 |
Don't pass DownloadItemModel ownership.
DownloadItemModel is a thin wrapper around DownloadItem*. It's
easier to instantiate it from a DownloadItem* than try to pass
ownership around.
Doing so was required when BaseDownloadItemModel existed, and the
actual model could be either a DownloadItemModel or a
SavePageModel. However this is no longer the case.
In addition, DownloadShelfContextMenu should track the lifetime
of the corresponding DownloadItem. It is possible for the
DownloadItem to be destroyed while the context menu is showing.
BUG=116551
Review URL: https://chromiumcodereview.appspot.com/11673004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_shelf.cc')
-rw-r--r-- | chrome/browser/download/download_shelf.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/browser/download/download_shelf.cc b/chrome/browser/download/download_shelf.cc index fa4f453..524ff7d 100644 --- a/chrome/browser/download/download_shelf.cc +++ b/chrome/browser/download/download_shelf.cc @@ -8,11 +8,11 @@ DownloadShelf::DownloadShelf() : should_show_on_unhide_(false), is_hidden_(false) {} -void DownloadShelf::AddDownload(DownloadItemModel* download_model) { +void DownloadShelf::AddDownload(content::DownloadItem* download) { if (is_hidden_) Unhide(); Show(); - DoAddDownload(download_model); + DoAddDownload(download); } void DownloadShelf::Show() { |