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

Issue 10735089: DownloadManager::Observer::OnDownloadCreated (Closed)

Created:
8 years, 5 months ago by benjhayden
Modified:
8 years, 5 months ago
CC:
chromium-reviews, mihaip-chromium-reviews_chromium.org, jam, joi+watch-content_chromium.org, Aaron Boodman, darin-cc_chromium.org, rdsmith+dwatch_chromium.org
Visibility:
Public.

Description

DownloadManager::Observer::OnDownloadCreated Currently, it is fired when the DownloadItem is created, not when it has its filename, not when it's persisted. Listeners should observe the item for those kinds of state changes. Those Observers that care about the filename (any of the filenames) should check whether it's empty() before using it. The DownloadItem[Impl] will UpdateObservers when the filename changes. OnDownloadCreated is not fired for SavePackage downloads. It will be fired when we are comfortable with the user interacting with them, which might not happen until after the SavePackage integration. ExtensionDownloadsEventRouter filters out temporary downloads, which are downloads whose DownloadCreateInfo.save_info.file_path is not empty(). GData also calls SetIsTemporary after OnDownloadCreated is fired, but only for SavePackage downloads, so EDER is safe there. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=148576

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : . #

Patch Set 4 : . #

Total comments: 6

Patch Set 5 : . #

Patch Set 6 : . #

Patch Set 7 : . #

Patch Set 8 : . #

Patch Set 9 : . #

Patch Set 10 : . #

Patch Set 11 : . #

Patch Set 12 : . #

Patch Set 13 : . #

Total comments: 18

Patch Set 14 : . #

Patch Set 15 : . #

Patch Set 16 : . #

Patch Set 17 : . #

Total comments: 8

Patch Set 18 : . #

Patch Set 19 : . #

Patch Set 20 : . #

Patch Set 21 : . #

Total comments: 12

Patch Set 22 : . #

Patch Set 23 : . #

Patch Set 24 : . #

Patch Set 25 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+117 lines, -121 lines) Patch
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 1 chunk +5 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 5 chunks +22 lines, -58 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api_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 8 chunks +22 lines, -48 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 3 chunks +1 line, -3 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 3 chunks +4 lines, -4 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 3 chunks +6 lines, -0 lines 0 comments Download
M content/browser/download/download_manager_impl_unittest.cc View 1 2 3 4 5 6 7 14 chunks +45 lines, -6 lines 0 comments Download
M content/public/browser/download_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +12 lines, -1 line 0 comments Download

Messages

Total messages: 23 (0 generated)
benjhayden
PTAL
8 years, 5 months ago (2012-07-13 20:15:51 UTC) #1
Randy Smith (Not in Mondays)
Two high level comments: * Don't forget to put some tests for these notifications in ...
8 years, 5 months ago (2012-07-14 19:39:13 UTC) #2
benjhayden
PTAL http://codereview.chromium.org/10735089/diff/6004/content/browser/download/download_manager_impl.cc File content/browser/download/download_manager_impl.cc (right): http://codereview.chromium.org/10735089/diff/6004/content/browser/download/download_manager_impl.cc#newcode968 content/browser/download/download_manager_impl.cc:968: FOR_EACH_OBSERVER(Observer, observers_, OnDownloadCreated(this, download)); On 2012/07/14 19:39:13, rdsmith ...
8 years, 5 months ago (2012-07-18 21:28:31 UTC) #3
Randy Smith (Not in Mondays)
I'm uncomfortable with this CL in that we now have two different states on the ...
8 years, 5 months ago (2012-07-19 17:25:36 UTC) #4
Randy Smith (Not in Mondays)
On 2012/07/19 17:25:36, rdsmith wrote: > I'm uncomfortable with this CL in that we now ...
8 years, 5 months ago (2012-07-19 17:27:44 UTC) #5
asanka
http://codereview.chromium.org/10735089/diff/19011/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): http://codereview.chromium.org/10735089/diff/19011/content/browser/download/download_item_impl.cc#newcode879 content/browser/download/download_item_impl.cc:879: // SetDangerType() may call UpdateObservers() again. On 2012/07/19 17:25:36, ...
8 years, 5 months ago (2012-07-19 18:14:07 UTC) #6
Randy Smith (Not in Mondays)
http://codereview.chromium.org/10735089/diff/19011/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): http://codereview.chromium.org/10735089/diff/19011/content/browser/download/download_item_impl.cc#newcode879 content/browser/download/download_item_impl.cc:879: // SetDangerType() may call UpdateObservers() again. On 2012/07/19 18:14:07, ...
8 years, 5 months ago (2012-07-19 18:16:51 UTC) #7
benjhayden
PTAL http://codereview.chromium.org/10735089/diff/19011/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): http://codereview.chromium.org/10735089/diff/19011/content/browser/download/download_item_impl.cc#newcode756 content/browser/download/download_item_impl.cc:756: UpdateObservers(); On 2012/07/19 17:25:36, rdsmith wrote: > I ...
8 years, 5 months ago (2012-07-23 15:58:42 UTC) #8
Randy Smith (Not in Mondays)
LGTM modulo nits below and agreement with Asanka about UpdateObservers modification in FDR III. http://codereview.chromium.org/10735089/diff/33001/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc ...
8 years, 5 months ago (2012-07-23 18:40:50 UTC) #9
benjhayden
Randy, not quite done with you yet. Asanka, PTAL. http://codereview.chromium.org/10735089/diff/33001/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc File chrome/browser/extensions/api/downloads/downloads_api_unittest.cc (right): http://codereview.chromium.org/10735089/diff/33001/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc#newcode171 chrome/browser/extensions/api/downloads/downloads_api_unittest.cc:171: ...
8 years, 5 months ago (2012-07-23 18:54:22 UTC) #10
Randy Smith (Not in Mondays)
http://codereview.chromium.org/10735089/diff/33001/content/public/browser/download_manager.h File content/public/browser/download_manager.h (right): http://codereview.chromium.org/10735089/diff/33001/content/public/browser/download_manager.h#newcode91 content/public/browser/download_manager.h:91: // of times at once. On 2012/07/23 18:54:22, benjhayden_chromium ...
8 years, 5 months ago (2012-07-23 19:00:06 UTC) #11
asanka
http://codereview.chromium.org/10735089/diff/19011/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): http://codereview.chromium.org/10735089/diff/19011/content/browser/download/download_item_impl.cc#newcode879 content/browser/download/download_item_impl.cc:879: // SetDangerType() may call UpdateObservers() again. On 2012/07/23 15:58:42, ...
8 years, 5 months ago (2012-07-23 19:10:20 UTC) #12
benjhayden
Randy, Asanka, PTAL. http://codereview.chromium.org/10735089/diff/19011/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): http://codereview.chromium.org/10735089/diff/19011/content/browser/download/download_item_impl.cc#newcode879 content/browser/download/download_item_impl.cc:879: // SetDangerType() may call UpdateObservers() again. ...
8 years, 5 months ago (2012-07-25 16:24:38 UTC) #13
asanka
http://codereview.chromium.org/10735089/diff/36001/chrome/browser/extensions/api/downloads/downloads_api.h File chrome/browser/extensions/api/downloads/downloads_api.h (right): http://codereview.chromium.org/10735089/diff/36001/chrome/browser/extensions/api/downloads/downloads_api.h#newcode222 chrome/browser/extensions/api/downloads/downloads_api.h:222: virtual void OnDownloadCreated(content::DownloadManager* manager, Nit: // content::DownloadManager::Observer http://codereview.chromium.org/10735089/diff/36001/chrome/browser/extensions/api/downloads/downloads_api.h#newcode225 chrome/browser/extensions/api/downloads/downloads_api.h:225: ...
8 years, 5 months ago (2012-07-25 19:36:34 UTC) #14
benjhayden
PTAL http://codereview.chromium.org/10735089/diff/36001/chrome/browser/extensions/api/downloads/downloads_api.h File chrome/browser/extensions/api/downloads/downloads_api.h (right): http://codereview.chromium.org/10735089/diff/36001/chrome/browser/extensions/api/downloads/downloads_api.h#newcode222 chrome/browser/extensions/api/downloads/downloads_api.h:222: virtual void OnDownloadCreated(content::DownloadManager* manager, On 2012/07/25 19:36:35, asanka ...
8 years, 5 months ago (2012-07-25 21:26:25 UTC) #15
asanka
http://codereview.chromium.org/10735089/diff/36001/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): http://codereview.chromium.org/10735089/diff/36001/content/browser/download/download_item_impl.cc#newcode893 content/browser/download/download_item_impl.cc:893: UpdateObservers(); On 2012/07/25 21:26:26, benjhayden_chromium wrote: > On 2012/07/25 ...
8 years, 5 months ago (2012-07-25 21:56:03 UTC) #16
benjhayden
http://codereview.chromium.org/10735089/diff/36001/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): http://codereview.chromium.org/10735089/diff/36001/content/browser/download/download_item_impl.cc#newcode893 content/browser/download/download_item_impl.cc:893: UpdateObservers(); On 2012/07/25 21:56:04, asanka wrote: > On 2012/07/25 ...
8 years, 5 months ago (2012-07-26 15:03:42 UTC) #17
asanka
LGTM
8 years, 5 months ago (2012-07-26 15:08:13 UTC) #18
benjhayden
Randy, PTAL? On 2012/07/26 15:08:13, asanka wrote: > LGTM Thanks!
8 years, 5 months ago (2012-07-26 15:21:15 UTC) #19
Randy Smith (Not in Mondays)
On 2012/07/26 15:21:15, benjhayden_chromium wrote: > Randy, PTAL? Does my previous LGTM not count? If ...
8 years, 5 months ago (2012-07-26 15:40:29 UTC) #20
benjhayden
On 2012/07/26 15:40:29, rdsmith wrote: > On 2012/07/26 15:21:15, benjhayden_chromium wrote: > > Randy, PTAL? ...
8 years, 5 months ago (2012-07-26 15:45:16 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/benjhayden@chromium.org/10735089/38005
8 years, 5 months ago (2012-07-26 15:46:12 UTC) #22
commit-bot: I haz the power
8 years, 5 months ago (2012-07-26 17:26:42 UTC) #23
Change committed as 148576

Powered by Google App Engine
This is Rietveld 408576698