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

Issue 10665049: Make DownloadHistory observe manager, items (Closed)

Created:
8 years, 5 months ago by benjhayden
Modified:
8 years, 3 months ago
Visibility:
Public.

Description

Make DownloadHistory observe manager, items Rip out half of DownloadManagerDelegate. Make DownloadManager create persisted DownloadItems one at a time and return them to DownloadHistory. Move DownloadPersistentStoreInfo from content to chrome. Kill DownloadDatabase::CheckThread(). (Leftover from 85408.) Change DownloadDatabase::RemoveDownloads() to take an explicit set of db_handles. Merge DownloadDatabase::UpdateDownload[Path](). SavePages are now visible in chrome://downloads and the shelf. Even huge pages like cnn.com finish so quickly that the user never has a chance to pause/resume/cancel them (so I'm not entirely sure what would happen if they did), and they are never marked as dangerous. Opening them works fine.

Patch Set 1 #

Patch Set 2 : merge #

Patch Set 3 : . #

Patch Set 4 : . #

Patch Set 5 : . #

Patch Set 6 : . #

Patch Set 7 : . #

Patch Set 8 : merge #

Patch Set 9 : . #

Patch Set 10 : . #

Total comments: 8

Patch Set 11 : merge #

Patch Set 12 : . #

Patch Set 13 : . #

Patch Set 14 : . #

Patch Set 15 : . #

Patch Set 16 : . #

Patch Set 17 : . #

Patch Set 18 : . #

Patch Set 19 : . #

Patch Set 20 : . #

Patch Set 21 : . #

Patch Set 22 : . #

Patch Set 23 : . #

Patch Set 24 : . #

Total comments: 39

Patch Set 25 : . #

Patch Set 26 : . #

Total comments: 29

Patch Set 27 : . #

Patch Set 28 : . #

Patch Set 29 : . #

Patch Set 30 : . #

Patch Set 31 : . #

Patch Set 32 : . #

Total comments: 38

Patch Set 33 : . #

Total comments: 1

Patch Set 34 : . #

Total comments: 2

Patch Set 35 : . #

Patch Set 36 : . #

Patch Set 37 : . #

Patch Set 38 : augh merging, ignore this #

Patch Set 39 : . #

Patch Set 40 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1552 lines, -1373 lines) Patch
M chrome/browser/download/chrome_download_manager_delegate.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 33 34 35 36 37 3 chunks +0 lines, -15 lines 0 comments Download
M chrome/browser/download/chrome_download_manager_delegate.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 32 33 34 35 36 37 38 5 chunks +16 lines, -64 lines 0 comments Download
M chrome/browser/download/download_browsertest.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 32 33 34 35 36 37 38 12 chunks +94 lines, -142 lines 0 comments Download
M chrome/browser/download/download_history.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 33 34 35 36 37 38 1 chunk +63 lines, -64 lines 0 comments Download
M chrome/browser/download/download_history.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 32 33 34 35 36 37 38 1 chunk +378 lines, -105 lines 0 comments Download
A chrome/browser/download/download_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 29 30 31 32 33 34 35 36 37 38 1 chunk +512 lines, -0 lines 0 comments Download
M chrome/browser/download/save_page_browsertest.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 32 33 34 35 36 37 38 12 chunks +43 lines, -69 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 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 5 chunks +7 lines, -13 lines 0 comments Download
M chrome/browser/history/download_database.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 33 34 5 chunks +12 lines, -21 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 29 30 31 32 33 34 35 9 chunks +32 lines, -86 lines 0 comments Download
A chrome/browser/history/download_persistent_store_info.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 +64 lines, -0 lines 0 comments Download
A + chrome/browser/history/download_persistent_store_info.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 +3 lines, -7 lines 0 comments Download
M chrome/browser/history/history.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 33 34 35 36 37 38 5 chunks +24 lines, -30 lines 0 comments Download
M chrome/browser/history/history.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 32 33 34 35 36 37 38 5 chunks +22 lines, -29 lines 0 comments Download
M chrome/browser/history/history_backend.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 33 34 35 36 37 38 2 chunks +9 lines, -14 lines 0 comments Download
M chrome/browser/history/history_backend.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 32 33 34 35 36 37 38 5 chunks +23 lines, -29 lines 0 comments Download
M chrome/browser/history/history_marshaling.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 33 34 35 1 chunk +0 lines, -8 lines 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 29 30 31 32 33 34 35 4 chunks +32 lines, -69 lines 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 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/downloads_dom_handler_browsertest.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 +11 lines, -17 lines 0 comments Download
M chrome/chrome_browser.gypi 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 33 34 35 36 37 38 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi 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 33 34 35 36 37 38 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/download/base_file.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +4 lines, -4 lines 0 comments Download
M content/browser/download/download_item_factory.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 33 34 35 36 37 38 3 chunks +10 lines, -6 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 30 31 32 33 34 35 36 37 38 6 chunks +9 lines, -16 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 31 32 33 34 35 36 37 38 12 chunks +20 lines, -68 lines 0 comments Download
M content/browser/download/download_manager_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 38 3 chunks +10 lines, -13 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 30 31 32 33 34 35 38 23 chunks +96 lines, -214 lines 0 comments Download
M content/browser/download/download_manager_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 30 31 9 chunks +32 lines, -80 lines 0 comments Download
M content/browser/download/download_stats.h View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M content/browser/download/download_stats.cc View 1 2 1 chunk +0 lines, -8 lines 0 comments Download
M content/content_browser.gypi 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 33 34 35 36 37 38 1 chunk +0 lines, -2 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 30 31 32 33 34 35 36 37 38 5 chunks +0 lines, -8 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 20 21 22 23 24 25 26 27 28 38 1 chunk +10 lines, -7 lines 0 comments Download
M content/public/browser/download_manager_delegate.h View 1 2 1 chunk +0 lines, -27 lines 0 comments Download
D content/public/browser/download_persistent_store_info.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -74 lines 0 comments Download
D content/public/browser/download_persistent_store_info.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -43 lines 0 comments Download
M content/public/test/mock_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 30 31 32 33 34 35 36 37 38 3 chunks +2 lines, -4 lines 0 comments Download
M content/public/test/mock_download_manager.h View 1 2 3 4 5 6 7 8 9 10 38 1 chunk +10 lines, -2 lines 0 comments Download
M content/shell/shell_download_manager_delegate.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 33 34 35 36 37 38 39 2 chunks +0 lines, -2 lines 0 comments Download
M content/shell/shell_download_manager_delegate.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 32 33 34 35 36 37 38 39 2 chunks +1 line, -8 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
Randy Smith (Not in Mondays)
Actually share notes with you :-}. http://codereview.chromium.org/10665049/diff/18001/chrome/browser/download/download_history.cc File chrome/browser/download/download_history.cc (right): http://codereview.chromium.org/10665049/diff/18001/chrome/browser/download/download_history.cc#newcode163 chrome/browser/download/download_history.cc:163: // |db_handle|, because ...
8 years, 4 months ago (2012-08-02 22:47:56 UTC) #1
benjhayden
PTAL I think this beast is finally ready for an initial review. Please feel free ...
8 years, 4 months ago (2012-08-14 21:31:47 UTC) #2
Randy Smith (Not in Mondays)
High level review. http://codereview.chromium.org/10665049/diff/18004/chrome/browser/download/download_history.cc File chrome/browser/download/download_history.cc (right): http://codereview.chromium.org/10665049/diff/18004/chrome/browser/download/download_history.cc#newcode4 chrome/browser/download/download_history.cc:4: Explanatory comment at top of file ...
8 years, 4 months ago (2012-08-15 20:47:43 UTC) #3
Randy Smith (Not in Mondays)
Two high level thoughts: -- I'd like to see the description rewritten a bit: * ...
8 years, 4 months ago (2012-08-15 20:49:58 UTC) #4
benjhayden
http://codereview.chromium.org/10665049/diff/18004/chrome/browser/download/download_history.cc File chrome/browser/download/download_history.cc (right): http://codereview.chromium.org/10665049/diff/18004/chrome/browser/download/download_history.cc#newcode4 chrome/browser/download/download_history.cc:4: On 2012/08/15 20:47:44, rdsmith wrote: > Explanatory comment at ...
8 years, 4 months ago (2012-08-17 18:20:45 UTC) #5
Randy Smith (Not in Mondays)
On 2012/08/17 18:20:45, benjhayden_chromium wrote: > Did the observing_items_ set trick instead. > I'll start ...
8 years, 4 months ago (2012-08-20 18:00:00 UTC) #6
Randy Smith (Not in Mondays)
Another round of pokes at download_history.*. http://codereview.chromium.org/10665049/diff/18004/chrome/browser/download/download_history.cc File chrome/browser/download/download_history.cc (right): http://codereview.chromium.org/10665049/diff/18004/chrome/browser/download/download_history.cc#newcode4 chrome/browser/download/download_history.cc:4: On 2012/08/17 18:20:45, ...
8 years, 4 months ago (2012-08-20 18:57:04 UTC) #7
benjhayden
Still working on the test failures, but feel free to take another look. http://codereview.chromium.org/10665049/diff/9065/chrome/browser/download/download_history.cc File ...
8 years, 4 months ago (2012-08-24 15:32:15 UTC) #8
Randy Smith (Not in Mondays)
Partial comments; still reviewing, but I'm heading out for the afternoon, so giving something to ...
8 years, 3 months ago (2012-08-27 18:25:11 UTC) #9
Randy Smith (Not in Mondays)
Rest of download_history* comments. Going on to rest of CL :-}. http://codereview.chromium.org/10665049/diff/9065/chrome/browser/download/download_history.cc File chrome/browser/download/download_history.cc (right): ...
8 years, 3 months ago (2012-08-27 19:28:19 UTC) #10
Randy Smith (Not in Mondays)
Non-test comments; will review tests when you've finished your work on them. http://codereview.chromium.org/10665049/diff/38003/chrome/browser/history/download_database.cc File chrome/browser/history/download_database.cc ...
8 years, 3 months ago (2012-08-28 13:11:49 UTC) #11
benjhayden
Timing RemoveDownloads() on linux: time to add 100,000 records: 3847.01 ms time to remove 100,000 ...
8 years, 3 months ago (2012-08-30 13:34:57 UTC) #12
Randy Smith (Not in Mondays)
On 2012/08/30 13:34:57, benjhayden_chromium wrote: > Timing RemoveDownloads() on linux: > time to add 100,000 ...
8 years, 3 months ago (2012-08-31 17:40:29 UTC) #13
benjhayden
I think the reason that this CL doesn't have any CC is because the first ...
8 years, 3 months ago (2012-09-10 19:02:56 UTC) #14
Randy Smith (Not in Mondays)
8 years, 3 months ago (2012-09-11 16:30:34 UTC) #15
Responses to comments on old CL; switching over to new CL now.

http://codereview.chromium.org/10665049/diff/38003/content/browser/download/d...
File content/browser/download/download_item_factory.h (right):

http://codereview.chromium.org/10665049/diff/38003/content/browser/download/d...
content/browser/download/download_item_factory.h:40: virtual DownloadItemImpl*
CreatePersistedItem(
On 2012/09/10 19:02:56, benjhayden_chromium wrote:
> On 2012/08/28 13:11:49, rdsmith wrote:
> > We need a better name for this.  Completed item?  "Finished" might be
better,
> > since there can be cancelled/interrupted items in this list.
> 
> There can also be IN_PROGRESS entries in the history, which DII rewrites as
> CANCELED.

They still end up being finished when they're put into the core downloads system
through this interface.  And I think of the IN_PROGRESS vs. finished distinction
as the key one here--we're not hooking the download item up to a file &
URLRequest, we're just creating it to hang out by itself.  This name makes the
concept of persisting part of the interface.

But I don't care a whole lot; you can keep it like this if you want.

http://codereview.chromium.org/10665049/diff/38003/content/browser/download/d...
File content/browser/download/download_manager_impl.cc (right):

http://codereview.chromium.org/10665049/diff/38003/content/browser/download/d...
content/browser/download/download_manager_impl.cc:483: NotifyModelChanged();
On 2012/09/10 19:02:56, benjhayden_chromium wrote:
> On 2012/08/28 13:11:49, rdsmith wrote:
> > Why are we doing a NotifyModelChanged() at the DMI level?  Nothing at the
DMI
> > level has changed, only things at the DII level.  Or am I missing something?
> 
> This was moved from AddDownloadItemToHistory().

Ok.  I think that what this is about then is the fact that we didn't
historically make downloads visible until after they were persisted.  So you
might want to consider removing this as part of one of your other CLs, since
we're changing that behavior.

Powered by Google App Engine
This is Rietveld 408576698