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

Issue 8404049: Added member data to classes to support download resumption. (Closed)

Created:
9 years, 1 month ago by ahendrickson
Modified:
9 years ago
CC:
chromium-reviews, achuith+watch_chromium.org, jam, dpranke-watch+content_chromium.org, joi+watch-content_chromium.org, rginda+watch_chromium.org, darin-cc_chromium.org, rdsmith+dwatch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

In order to resume a download some more information needs to be gathered. This CL adds member data to classes to support this. It is the first of several CLs to implement download resumption. In addition hash information is propagated from DownloadFile to DownloadItem, because a new DownloadFile will be created when the download is resumed. It will also need to be persisted in order to resume across chrome runs. The plan is that data will be collected in DownloadResourceHandler::OnResponseStarted() and passed down to DownloadItem. On resume, it will pass the information from the resuming DownloadItem to ResourceDispatcherHost::BeginDownload(), which will set any required headers. BUG=7648 TEST=None Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=115573

Patch Set 1 #

Patch Set 2 : Cleanup #

Patch Set 3 : Merged with trunk #

Total comments: 25

Patch Set 4 : Partial changes from comments. #

Patch Set 5 : Merged with trunk. #

Patch Set 6 : Merged with trunk. #

Total comments: 7

Patch Set 7 : Cleanup, and added fields to DownloadPersistentStoreInfo. #

Total comments: 16

Patch Set 8 : Incorporated Randy's comments. #

Total comments: 21

Patch Set 9 : Switched to saving the hash state instead of an intermediate hash. #

Patch Set 10 : Merged with trunk #

Patch Set 11 : The other half of the conversion to using hash states. #

Patch Set 12 : Added unit test. #

Patch Set 13 : Merged with trunk #

Total comments: 11

Patch Set 14 : Fixed bug in getting/setting the hash state. #

Patch Set 15 : Now passing around the hash state in a string instead of a Pickle. #

Patch Set 16 : Added target path to persistent info. #

Patch Set 17 : Rearranged structures for greater consistency. #

Total comments: 24

Patch Set 18 : Renamed accessors now that DownloadItem is an interface. #

Patch Set 19 : Removed DownloadPersistentStoreInfo changes. #

Patch Set 20 : DownloadSaveInfo::offset is now int64. #

Total comments: 11

Patch Set 21 : Merged with trunk. #

Patch Set 22 : Merged with trunk #

Patch Set 23 : Fixed merge errors #

Patch Set 24 : Moved BaseFile hash initialization to the constructor. #

Patch Set 25 : Updated comment. #

Total comments: 4

Patch Set 26 : BaseFile unit tests now generate the expected hash values. #

Patch Set 27 : Fixed order error in calculating expected hash. #

Patch Set 28 : Merged with trunk #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1838 lines, -1496 lines) Patch
M chrome/browser/download/download_item_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 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/download/download_manager_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 9 chunks +28 lines, -17 lines 0 comments Download
M content/browser/download/base_file.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 4 chunks +15 lines, -8 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 17 18 19 20 21 22 23 5 chunks +38 lines, -9 lines 0 comments Download
M content/browser/download/base_file_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 22 chunks +168 lines, -45 lines 0 comments Download
M content/browser/download/download_create_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 1 chunk +9 lines, -1 line 0 comments Download
M content/browser/download/download_file_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 2 chunks +5 lines, -3 lines 0 comments Download
M content/browser/download/download_file_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 3 chunks +12 lines, -5 lines 0 comments Download
M content/browser/download/download_file_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 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/download/download_file_manager.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 8 chunks +37 lines, -18 lines 0 comments Download
M content/browser/download/download_file_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 4 chunks +8 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 1 chunk +377 lines, -353 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 1 chunk +1008 lines, -978 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 24 25 26 27 1 chunk +7 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 5 chunks +9 lines, -6 lines 0 comments Download
M content/browser/download/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 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/download/download_request_handle.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 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/download/download_resource_handler.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 1 chunk +1 line, -1 line 0 comments Download
M content/browser/download/download_resource_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 2 chunks +11 lines, -3 lines 0 comments Download
M content/browser/download/download_types.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +13 lines, -0 lines 0 comments Download
M content/browser/download/download_types.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +7 lines, -2 lines 0 comments Download
M content/browser/download/mock_download_file.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 2 chunks +3 lines, -2 lines 0 comments Download
M content/browser/download/mock_download_file.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 2 chunks +6 lines, -2 lines 0 comments Download
M content/browser/download/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 3 chunks +5 lines, -2 lines 0 comments Download
M content/browser/download/mock_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 1 chunk +7 lines, -3 lines 0 comments Download
M content/browser/download/mock_download_manager.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 2 chunks +7 lines, -3 lines 0 comments Download
M content/browser/download/save_file.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 2 chunks +3 lines, -3 lines 0 comments Download
M content/browser/download/save_file.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 +12 lines, -6 lines 0 comments Download
M content/browser/download/save_file_manager.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 1 chunk +3 lines, -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 14 15 16 17 18 19 20 21 22 23 24 25 26 27 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host_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 1 chunk +4 lines, -0 lines 0 comments Download
M content/public/browser/download_file.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 2 chunks +5 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 4 chunks +13 lines, -2 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 2 chunks +9 lines, -3 lines 0 comments Download

Messages

Total messages: 30 (0 generated)
ahendrickson
9 years, 1 month ago (2011-10-28 18:07:21 UTC) #1
Randy Smith (Not in Mondays)
So some high level comments. These are all from the perspective of "interface design", where ...
9 years, 1 month ago (2011-10-31 18:46:43 UTC) #2
ahendrickson
http://codereview.chromium.org/8404049/diff/3014/content/browser/download/base_file.h File content/browser/download/base_file.h (right): http://codereview.chromium.org/8404049/diff/3014/content/browser/download/base_file.h#newcode69 content/browser/download/base_file.h:69: bool GetPartialSha256Hash(std::string* hash); On 2011/10/31 18:46:43, rdsmith wrote: > ...
9 years, 1 month ago (2011-11-13 21:15:19 UTC) #3
Randy Smith (Not in Mondays)
Thoughts on your responses to my initial pass. My apologies--we're at a conversation level with ...
9 years, 1 month ago (2011-11-15 18:35:25 UTC) #4
Randy Smith (Not in Mondays)
More interface level comments--I'm holding off on reviewing the implementation until we're in sync on ...
9 years, 1 month ago (2011-11-15 18:45:26 UTC) #5
ahendrickson
http://codereview.chromium.org/8404049/diff/3014/content/browser/download/base_file.h File content/browser/download/base_file.h (right): http://codereview.chromium.org/8404049/diff/3014/content/browser/download/base_file.h#newcode74 content/browser/download/base_file.h:74: bool SetPartialSha256Hash(const std::string& hash); On 2011/11/15 18:35:25, rdsmith wrote: ...
9 years, 1 month ago (2011-11-16 15:41:08 UTC) #6
Randy Smith (Not in Mondays)
Just interface level comments. I think we're converging enough that I'll dive into a general ...
9 years, 1 month ago (2011-11-16 18:29:26 UTC) #7
Randy Smith (Not in Mondays)
This seems light on tests. I made on suggestion below, and it may be appropriate ...
9 years, 1 month ago (2011-11-16 21:40:25 UTC) #8
Randy Smith (Not in Mondays)
On 2011/11/16 21:40:25, rdsmith wrote: http://codereview.chromium.org/8404049/diff/31002/content/browser/download/download_resource_handler.h#newcode84 > content/browser/download/download_resource_handler.h:84: void > set_start_offset(int64 bytes) { start_offset_ = ...
9 years, 1 month ago (2011-11-16 21:42:43 UTC) #9
ahendrickson
http://codereview.chromium.org/8404049/diff/3014/content/browser/download/download_create_info.h File content/browser/download/download_create_info.h (right): http://codereview.chromium.org/8404049/diff/3014/content/browser/download/download_create_info.h#newcode91 content/browser/download/download_create_info.h:91: std::string last_modified; On 2011/11/16 18:29:27, rdsmith wrote: > On ...
9 years, 1 month ago (2011-11-19 20:18:03 UTC) #10
Randy Smith (Not in Mondays)
I'm holding off on my next through review until after we resolve the Pickle issue; ...
9 years, 1 month ago (2011-11-21 02:10:16 UTC) #11
ahendrickson
Do you think I should add any particular reviewers, once you're happy with this? http://codereview.chromium.org/8404049/diff/25001/content/browser/download/base_file.h ...
9 years, 1 month ago (2011-11-21 20:34:46 UTC) #12
Randy Smith (Not in Mondays)
Interface (.h file) round. A couple of high level comments: * Reviewers: I'd bring Ben ...
9 years, 1 month ago (2011-11-22 17:37:49 UTC) #13
ahendrickson
Removed the DownloadPersistentStoreInfo changes. http://codereview.chromium.org/8404049/diff/44001/content/browser/download/download_item.h File content/browser/download/download_item.h (right): http://codereview.chromium.org/8404049/diff/44001/content/browser/download/download_item.h#newcode153 content/browser/download/download_item.h:153: void Update(int64 bytes_so_far, const Pickle& ...
9 years, 1 month ago (2011-11-22 23:46:44 UTC) #14
Randy Smith (Not in Mondays)
.h file (interface) comments. Will continue review at .cc file level. http://codereview.chromium.org/8404049/diff/44001/content/browser/download/download_item.h File content/browser/download/download_item.h (right): ...
9 years, 1 month ago (2011-11-23 19:25:13 UTC) #15
Randy Smith (Not in Mondays)
Only one non-interface comment (makes sense, as this CL is primarily about interface changes.) http://codereview.chromium.org/8404049/diff/61001/content/browser/download/download_item_impl.cc ...
9 years, 1 month ago (2011-11-23 19:40:24 UTC) #16
ahendrickson
PTAL. http://codereview.chromium.org/8404049/diff/44001/content/browser/download/download_item.h File content/browser/download/download_item.h (right): http://codereview.chromium.org/8404049/diff/44001/content/browser/download/download_item.h#newcode153 content/browser/download/download_item.h:153: void Update(int64 bytes_so_far, const Pickle& hash_state); On 2011/11/23 ...
9 years ago (2011-12-20 00:04:13 UTC) #17
Randy Smith (Not in Mondays)
Very close. Thanks for being patient with my reivews.... http://codereview.chromium.org/8404049/diff/44001/content/browser/download/download_item.h File content/browser/download/download_item.h (right): http://codereview.chromium.org/8404049/diff/44001/content/browser/download/download_item.h#newcode153 content/browser/download/download_item.h:153: ...
9 years ago (2011-12-20 17:05:40 UTC) #18
ahendrickson
http://codereview.chromium.org/8404049/diff/44001/content/browser/download/download_item.h File content/browser/download/download_item.h (right): http://codereview.chromium.org/8404049/diff/44001/content/browser/download/download_item.h#newcode153 content/browser/download/download_item.h:153: void Update(int64 bytes_so_far, const Pickle& hash_state); On 2011/12/20 17:05:40, ...
9 years ago (2011-12-20 22:06:54 UTC) #19
Randy Smith (Not in Mondays)
LGTM, with the caveat agreed on offline that I'd like the initial hash state nulled ...
9 years ago (2011-12-21 19:14:49 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ahendrickson@chromium.org/8404049/84002
9 years ago (2011-12-21 19:56:14 UTC) #21
commit-bot: I haz the power
Presubmit check for 8404049-84002 failed and returned exit status 1. Running presubmit commit checks ...
9 years ago (2011-12-21 19:56:33 UTC) #22
ahendrickson
jam, PTAL at the stuff outside of content/browser/download/
9 years ago (2011-12-21 20:01:21 UTC) #23
jam
lgtm
9 years ago (2011-12-21 21:48:31 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ahendrickson@chromium.org/8404049/84002
9 years ago (2011-12-22 03:36:16 UTC) #25
commit-bot: I haz the power
Presubmit check for 8404049-84002 failed and returned exit status 1. Running presubmit commit checks ...
9 years ago (2011-12-22 03:36:33 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ahendrickson@chromium.org/8404049/84002
9 years ago (2011-12-22 12:02:53 UTC) #27
commit-bot: I haz the power
Presubmit check for 8404049-84002 failed and returned exit status 1. Running presubmit commit checks ...
9 years ago (2011-12-22 12:03:09 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ahendrickson@chromium.org/8404049/84002
9 years ago (2011-12-22 17:03:43 UTC) #29
commit-bot: I haz the power
9 years ago (2011-12-22 19:22:44 UTC) #30
Change committed as 115573

Powered by Google App Engine
This is Rietveld 408576698