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

Issue 11673004: No need to pass DownloadItemModel ownership. (Closed)

Created:
7 years, 12 months ago by asanka
Modified:
7 years, 11 months ago
CC:
chromium-reviews, benjhayden+dwatch_chromium.org, tfarina, Randy Smith (Not in Mondays), sail+watch_chromium.org, rdsmith+dwatch_chromium.org
Visibility:
Public.

Description

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 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=175558

Patch Set 1 : #

Total comments: 4

Patch Set 2 : DownloadShelfContextMenu class cleanup and require GetMenuModel() to return non-NULL #

Unified diffs Side-by-side diffs Delta from patch set Stats (+222 lines, -204 lines) Patch
M chrome/browser/download/download_item_model.h View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/download/download_item_model.cc View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/download/download_shelf.h View 3 chunks +8 lines, -5 lines 0 comments Download
M chrome/browser/download/download_shelf.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/download/download_shelf_context_menu.h View 1 4 chunks +16 lines, -11 lines 0 comments Download
M chrome/browser/download/download_shelf_context_menu.cc View 1 7 chunks +40 lines, -11 lines 0 comments Download
M chrome/browser/download/test_download_shelf.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/download/test_download_shelf.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/browser.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_item_controller.h View 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_item_controller.mm View 3 chunks +8 lines, -8 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_item_mac.h View 4 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_item_mac.mm View 4 chunks +11 lines, -10 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_shelf_controller.h View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_shelf_controller.mm View 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_shelf_mac.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/download/download_shelf_mac.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/gtk/download/download_item_gtk.h View 5 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/gtk/download/download_item_gtk.cc View 25 chunks +39 lines, -43 lines 0 comments Download
M chrome/browser/ui/gtk/download/download_shelf_context_menu_gtk.h View 1 chunk +1 line, -3 lines 0 comments Download
M chrome/browser/ui/gtk/download/download_shelf_context_menu_gtk.cc View 1 2 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/ui/gtk/download/download_shelf_gtk.h View 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/ui/gtk/download/download_shelf_gtk.cc View 4 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/download/download_item_view.h View 6 chunks +5 lines, -11 lines 0 comments Download
M chrome/browser/ui/views/download/download_item_view.cc View 23 chunks +42 lines, -45 lines 0 comments Download
M chrome/browser/ui/views/download/download_shelf_context_menu_view.h View 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/download/download_shelf_context_menu_view.cc View 1 chunk +7 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/download/download_shelf_view.h View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/download/download_shelf_view.cc View 1 chunk +2 lines, -3 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
asanka
sky: This stems partly from https://codereview.chromium.org/11419169/#msg4 . Ownership of DownloadItemModel doesn't need to be passed ...
7 years, 12 months ago (2012-12-27 20:32:27 UTC) #1
Randy Smith (Not in Mondays)
chrome/browser/download LGTM. [Not for this CL] I find myself wondering if there's a better base ...
7 years, 12 months ago (2012-12-28 19:02:46 UTC) #2
sky
https://codereview.chromium.org/11673004/diff/4001/chrome/browser/ui/views/download/download_shelf_context_menu_view.cc File chrome/browser/ui/views/download/download_shelf_context_menu_view.cc (right): https://codereview.chromium.org/11673004/diff/4001/chrome/browser/ui/views/download/download_shelf_context_menu_view.cc#newcode29 chrome/browser/ui/views/download/download_shelf_context_menu_view.cc:29: DCHECK(menu_model); How come this is a DCHECK, but in ...
7 years, 11 months ago (2013-01-07 18:28:24 UTC) #3
asanka
https://codereview.chromium.org/11673004/diff/4001/chrome/browser/download/download_shelf_context_menu.h File chrome/browser/download/download_shelf_context_menu.h (right): https://codereview.chromium.org/11673004/diff/4001/chrome/browser/download/download_shelf_context_menu.h#newcode62 chrome/browser/download/download_shelf_context_menu.h:62: virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; On 2012/12/28 19:02:46, rdsmith ...
7 years, 11 months ago (2013-01-07 20:19:25 UTC) #4
sky
LGTM
7 years, 11 months ago (2013-01-07 22:02:51 UTC) #5
asanka
On 2013/01/07 22:02:51, sky wrote: > LGTM Thanks!
7 years, 11 months ago (2013-01-07 22:09:15 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asanka@chromium.org/11673004/10001
7 years, 11 months ago (2013-01-07 23:19:30 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asanka@chromium.org/11673004/10001
7 years, 11 months ago (2013-01-08 15:11:36 UTC) #8
commit-bot: I haz the power
7 years, 11 months ago (2013-01-08 18:27:32 UTC) #9
Message was sent while issue was closed.
Change committed as 175558

Powered by Google App Engine
This is Rietveld 408576698