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

Issue 10704026: Reland DownloadItem::Observer::OnDownloadDestroyed() replaces DownloadItem::REMOVING (Closed)

Created:
8 years, 5 months ago by benjhayden
Modified:
8 years, 4 months ago
CC:
chromium-reviews, asanka, mihaip-chromium-reviews_chromium.org, jochen+watch-content_chromium.org, jam, kkania, dcheng, joi+watch-content_chromium.org, robertshield, rdsmith+dwatch_chromium.org, brettw-cc_chromium.org, darin-cc_chromium.org, stuartmorgan+watch_chromium.org
Visibility:
Public.

Description

Reland DownloadItem::Observer::OnDownloadDestroyed() replaces DownloadItem::REMOVING Changes from original CL only in downloads_api.* Reviewers: Ben Goodger: chrome/browser/ui/views/download/download_item_view.*, chrome/browser/plugin_installer.*, chrome/browser/automation/automation_provider.cc rdsmith, asanka: all Nico (thakis): chrome/browser/ui/cocoa/download/download_item_mac.* Achuith: chrome/browser/chromeos/gdata/gdata_download_observer.* Evan (estade): chrome/browser/ui/gtk/download/download_item_gtk.*, chrome/browser/ui/webui/downloads_dom_handler.* Scott (sky): chrome/browser/history/history_unittest.cc Aaron (aa): chrome/browser/extensions/webstore_installer.* Add DownloadItem::Observer::OnDownloadRemoved() to signal when a download is being removed from history. Make chrome.downloads.onErased trigger from DownloadItem::Observer::OnDownloadRemoved() so that extensions don't think that all downloads are being erased just because the browser is closing. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=149794 Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=150086 http://crbug.com/140687 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=150890

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : . #

Total comments: 8

Patch Set 4 : . #

Patch Set 5 : . #

Patch Set 6 : . #

Patch Set 7 : merge #

Total comments: 24

Patch Set 8 : . #

Patch Set 9 : . #

Patch Set 10 : . #

Patch Set 11 : . #

Patch Set 12 : . #

Patch Set 13 : . #

Total comments: 8

Patch Set 14 : . #

Patch Set 15 : . #

Patch Set 16 : . #

Patch Set 17 : . #

Patch Set 18 : . #

Patch Set 19 : . #

Patch Set 20 : . #

Total comments: 2

Patch Set 21 : . #

Patch Set 22 : . #

Total comments: 2

Patch Set 23 : merge #

Patch Set 24 : . #

Patch Set 25 : merge #

Patch Set 26 : . #

Patch Set 27 : merge after revert #

Patch Set 28 : do not crash in downloads_api if invalid state #

Patch Set 29 : merge #

Patch Set 30 : DownloadStatusUpdater::OnDownloadDestroyed #

Patch Set 31 : . #

Patch Set 32 : download_completion_observer_win #

Patch Set 33 : lint #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+205 lines, -155 lines) Patch
M chrome/browser/automation/automation_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/chromeos/gdata/gdata_download_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/gdata/gdata_download_observer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/download/download_completion_observer_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/download/download_completion_observer_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/download/download_item_model.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/download/download_path_reservation_tracker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 3 chunks +7 lines, -9 lines 0 comments Download
M chrome/browser/download/download_path_reservation_tracker_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/download/download_status_updater.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/download/download_status_updater.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 2 chunks +9 lines, -2 lines 3 comments Download
M chrome/browser/download/download_test_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/download/download_test_observer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +14 lines, -18 lines 0 comments Download
M chrome/browser/download/download_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 6 chunks +29 lines, -21 lines 0 comments Download
M chrome/browser/extensions/webstore_installer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/webstore_installer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 2 chunks +3 lines, -5 lines 0 comments Download
M chrome/browser/history/download_database.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/history/history_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/plugin_installer.h View 1 2 3 4 5 6 7 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/plugin_installer.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -6 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_item_mac.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_item_mac.mm View 1 2 3 4 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/ui/gtk/download/download_item_gtk.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/download/download_item_gtk.cc View 1 2 3 4 5 6 7 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/download/download_item_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/download/download_item_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/downloads_dom_handler.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/downloads_dom_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +11 lines, -8 lines 0 comments Download
M content/browser/download/download_item_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/download/download_item_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 3 chunks +6 lines, -5 lines 0 comments Download
M content/browser/download/download_item_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3 chunks +40 lines, -3 lines 0 comments Download
M content/browser/download/download_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 5 chunks +9 lines, -25 lines 0 comments Download
M content/browser/download/drag_download_file.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M content/browser/download/drag_download_file.cc View 1 2 3 4 5 6 7 8 9 2 chunks +12 lines, -2 lines 0 comments Download
M content/browser/download/save_package.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/download/save_package.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -9 lines 0 comments Download
M content/public/browser/download_item.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 2 chunks +10 lines, -6 lines 0 comments Download

Messages

Total messages: 40 (0 generated)
benjhayden
PTAL
8 years, 5 months ago (2012-06-29 17:18:46 UTC) #1
Randy Smith (Not in Mondays)
http://codereview.chromium.org/10704026/diff/4002/chrome/browser/download/download_item_model.cc File chrome/browser/download/download_item_model.cc (left): http://codereview.chromium.org/10704026/diff/4002/chrome/browser/download/download_item_model.cc#oldcode131 chrome/browser/download/download_item_model.cc:131: case DownloadItem::REMOVING: Asanka, what protection is there in DownloadItemModel ...
8 years, 5 months ago (2012-06-29 19:34:54 UTC) #2
Randy Smith (Not in Mondays)
Whoops, one other high level request: Could you change the issue description not to use ...
8 years, 5 months ago (2012-06-29 19:35:24 UTC) #3
benjhayden
PTAL http://codereview.chromium.org/10704026/diff/4002/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (left): http://codereview.chromium.org/10704026/diff/4002/content/browser/download/download_item_impl.cc#oldcode323 content/browser/download/download_item_impl.cc:323: delegate_->AssertStateConsistent(this); On 2012/06/29 19:34:54, rdsmith wrote: > Why? ...
8 years, 5 months ago (2012-07-10 16:58:57 UTC) #4
Randy Smith (Not in Mondays)
On 2012/07/10 16:58:57, benjhayden_chromium wrote: > PTAL > > http://codereview.chromium.org/10704026/diff/4002/content/browser/download/download_item_impl.cc > File content/browser/download/download_item_impl.cc (left): > ...
8 years, 5 months ago (2012-07-10 18:52:37 UTC) #5
Randy Smith (Not in Mondays)
Could you add some tests for the new notifications in download_item_impl_unittest.cc? Didn't review download_path_reservation_tracker_unittest.cc; presuming ...
8 years, 5 months ago (2012-07-11 17:55:36 UTC) #6
asanka
http://codereview.chromium.org/10704026/diff/4002/chrome/browser/download/download_item_model.cc File chrome/browser/download/download_item_model.cc (left): http://codereview.chromium.org/10704026/diff/4002/chrome/browser/download/download_item_model.cc#oldcode131 chrome/browser/download/download_item_model.cc:131: case DownloadItem::REMOVING: On 2012/06/29 19:34:54, rdsmith wrote: > Asanka, ...
8 years, 5 months ago (2012-07-11 18:12:19 UTC) #7
benjhayden
PTAL http://codereview.chromium.org/10704026/diff/17003/chrome/browser/automation/automation_provider.cc File chrome/browser/automation/automation_provider.cc (left): http://codereview.chromium.org/10704026/diff/17003/chrome/browser/automation/automation_provider.cc#oldcode307 chrome/browser/automation/automation_provider.cc:307: state_to_string[DownloadItem::REMOVING] = std::string("REMOVING"); On 2012/07/11 17:55:37, rdsmith wrote: ...
8 years, 5 months ago (2012-07-13 20:03:17 UTC) #8
Randy Smith (Not in Mondays)
I didn't see new tests for the new notifications in download_item_impl_unittests.cc? http://codereview.chromium.org/10704026/diff/17003/chrome/browser/automation/automation_provider.cc File chrome/browser/automation/automation_provider.cc (left): ...
8 years, 5 months ago (2012-07-14 19:25:52 UTC) #9
benjhayden
PTAL. http://codereview.chromium.org/10704026/diff/17003/chrome/browser/automation/automation_provider.cc File chrome/browser/automation/automation_provider.cc (left): http://codereview.chromium.org/10704026/diff/17003/chrome/browser/automation/automation_provider.cc#oldcode307 chrome/browser/automation/automation_provider.cc:307: state_to_string[DownloadItem::REMOVING] = std::string("REMOVING"); On 2012/07/14 19:25:53, rdsmith wrote: ...
8 years, 5 months ago (2012-07-23 15:43:09 UTC) #10
Randy Smith (Not in Mondays)
http://codereview.chromium.org/10704026/diff/10053/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): http://codereview.chromium.org/10704026/diff/10053/content/browser/download/download_item_impl.cc#newcode661 content/browser/download/download_item_impl.cc:661: FOR_EACH_OBSERVER(Observer, observers_, OnDownloadRemoved(this)); On 2012/07/23 15:43:09, benjhayden_chromium wrote: > ...
8 years, 5 months ago (2012-07-23 18:30:42 UTC) #11
benjhayden
I can kill DII::NotifyRemoved() with the DownloadHistoryUpdater, if that sounds good to you. http://codereview.chromium.org/10704026/diff/10053/content/browser/download/download_item_impl.cc File ...
8 years, 5 months ago (2012-07-25 15:37:48 UTC) #12
Randy Smith (Not in Mondays)
LGTM.
8 years, 5 months ago (2012-07-26 13:45:40 UTC) #13
benjhayden
Asanka, PTAL? On 2012/07/26 13:45:40, rdsmith wrote: > LGTM. Thanks!
8 years, 5 months ago (2012-07-26 14:37:39 UTC) #14
asanka
LGTM http://codereview.chromium.org/10704026/diff/53001/chrome/browser/ui/views/download/download_item_view.h File chrome/browser/ui/views/download/download_item_view.h (right): http://codereview.chromium.org/10704026/diff/53001/chrome/browser/ui/views/download/download_item_view.h#newcode78 chrome/browser/ui/views/download/download_item_view.h:78: // DownloadObserver methods Nit: DownloadItem::Observer
8 years, 5 months ago (2012-07-26 15:30:53 UTC) #15
benjhayden
Thanks! I'll hit the CQ when the bots come back. http://codereview.chromium.org/10704026/diff/53001/chrome/browser/ui/views/download/download_item_view.h File chrome/browser/ui/views/download/download_item_view.h (right): http://codereview.chromium.org/10704026/diff/53001/chrome/browser/ui/views/download/download_item_view.h#newcode78 ...
8 years, 5 months ago (2012-07-26 15:54:05 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/benjhayden@chromium.org/10704026/68002
8 years, 5 months ago (2012-07-26 17:05:56 UTC) #17
commit-bot: I haz the power
Presubmit check for 10704026-68002 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 5 months ago (2012-07-26 17:06:14 UTC) #18
benjhayden
I'll ping all of you separately, but PTAL. On 2012/07/26 17:06:14, I haz the power ...
8 years, 5 months ago (2012-07-26 17:30:51 UTC) #19
Nico
_mac lgtm
8 years, 5 months ago (2012-07-26 17:32:09 UTC) #20
Evan Stade
lgtm http://codereview.chromium.org/10704026/diff/68002/chrome/browser/ui/webui/downloads_dom_handler.cc File chrome/browser/ui/webui/downloads_dom_handler.cc (right): http://codereview.chromium.org/10704026/diff/68002/chrome/browser/ui/webui/downloads_dom_handler.cc#newcode195 chrome/browser/ui/webui/downloads_dom_handler.cc:195: *it = NULL; why are you nulling rather ...
8 years, 5 months ago (2012-07-26 21:34:17 UTC) #21
achuithb
gdata/* changes lgtm
8 years, 5 months ago (2012-07-26 23:17:58 UTC) #22
benjhayden
http://codereview.chromium.org/10704026/diff/68002/chrome/browser/ui/webui/downloads_dom_handler.cc File chrome/browser/ui/webui/downloads_dom_handler.cc (right): http://codereview.chromium.org/10704026/diff/68002/chrome/browser/ui/webui/downloads_dom_handler.cc#newcode195 chrome/browser/ui/webui/downloads_dom_handler.cc:195: *it = NULL; On 2012/07/26 21:34:18, Evan Stade wrote: ...
8 years, 4 months ago (2012-07-27 19:43:34 UTC) #23
sky
LGTM
8 years, 4 months ago (2012-07-31 16:19:42 UTC) #24
Aaron Boodman
LGTM
8 years, 4 months ago (2012-08-01 09:34:47 UTC) #25
Ben Goodger (Google)
lgtm for download_item_view*, plugin_installer* and automation_provider.cc
8 years, 4 months ago (2012-08-01 15:16:23 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/benjhayden@chromium.org/10704026/65040
8 years, 4 months ago (2012-08-01 20:29:49 UTC) #27
commit-bot: I haz the power
Try job failure for 10704026-65040 (retry) on win_rel for step "unit_tests". It's a second try, ...
8 years, 4 months ago (2012-08-01 23:12:32 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/benjhayden@chromium.org/10704026/61009
8 years, 4 months ago (2012-08-02 23:41:14 UTC) #29
commit-bot: I haz the power
Change committed as 149794
8 years, 4 months ago (2012-08-03 03:07:52 UTC) #30
Randy Smith (Not in Mondays)
So just to confirm: The protection against the recent crashes seen in canary from this ...
8 years, 4 months ago (2012-08-08 20:24:10 UTC) #31
benjhayden
Anybody else following along, please feel free to take another look now before I reland. ...
8 years, 4 months ago (2012-08-08 20:46:46 UTC) #32
Randy Smith (Not in Mondays)
Actually, one more thought. I just noticed that you don't have the DownloadStatusUpdater as one ...
8 years, 4 months ago (2012-08-08 21:22:40 UTC) #33
Aaron Boodman
c/b/e lgtm
8 years, 4 months ago (2012-08-08 21:45:22 UTC) #34
sky
LGTM
8 years, 4 months ago (2012-08-08 22:14:40 UTC) #35
Randy Smith (Not in Mondays)
download_status_updater.*, downloads_completion_observer_win.* LGTM. http://codereview.chromium.org/10704026/diff/73080/chrome/browser/download/download_status_updater.cc File chrome/browser/download/download_status_updater.cc (right): http://codereview.chromium.org/10704026/diff/73080/chrome/browser/download/download_status_updater.cc#newcode86 chrome/browser/download/download_status_updater.cc:86: UpdateAppIconDownloadProgress(); I don't actually think you ...
8 years, 4 months ago (2012-08-09 17:03:44 UTC) #36
benjhayden
http://codereview.chromium.org/10704026/diff/73080/chrome/browser/download/download_status_updater.cc File chrome/browser/download/download_status_updater.cc (right): http://codereview.chromium.org/10704026/diff/73080/chrome/browser/download/download_status_updater.cc#newcode86 chrome/browser/download/download_status_updater.cc:86: UpdateAppIconDownloadProgress(); On 2012/08/09 17:03:44, rdsmith wrote: > I don't ...
8 years, 4 months ago (2012-08-09 18:35:06 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/benjhayden@chromium.org/10704026/73080
8 years, 4 months ago (2012-08-09 19:09:24 UTC) #38
Randy Smith (Not in Mondays)
http://codereview.chromium.org/10704026/diff/73080/chrome/browser/download/download_status_updater.cc File chrome/browser/download/download_status_updater.cc (right): http://codereview.chromium.org/10704026/diff/73080/chrome/browser/download/download_status_updater.cc#newcode86 chrome/browser/download/download_status_updater.cc:86: UpdateAppIconDownloadProgress(); On 2012/08/09 18:35:06, benjhayden_chromium wrote: > On 2012/08/09 ...
8 years, 4 months ago (2012-08-09 20:27:32 UTC) #39
commit-bot: I haz the power
8 years, 4 months ago (2012-08-09 20:39:00 UTC) #40
Change committed as 150890

Powered by Google App Engine
This is Rietveld 408576698