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

Issue 6969009: Reduced the lifetime of DownloadCreateInfo. (Closed)

Created:
9 years, 7 months ago by ahendrickson
Modified:
9 years, 7 months ago
CC:
chromium-reviews, rginda+watch_chromium.org, brettw-cc_chromium.org, achuith+watch_chromium.org, rdsmith+dwatch_chromium.org
Visibility:
Public.

Description

Part 2 of downloads data flow refactor. Reduced the lifetime of DownloadCreateInfo. DownloadCreateInfo now only lives until DownloadFileManager::CreateDownloadFile(). It's contents are put into DownloadItem, and then only the download ID is passed around to get at the information. In addition, most of DownloadItem's members are grouped into sub-structures by functionality: - history_ Passed to the history data base, and includes the data relevant to that. - request_ Contains the information about the request, which is not present in the other structures. - state_ Contains data that is used to manage the download process. It is part of DownloadItem because it is specific to that item, but it could instead be passed around as an extra parameter. Some notes on the refactoring: - DownloadItem is only accessed in the UI thread. This means that the state_ structure needs to be passed by value to DownloadManager::CheckIfSuggestedPathExists(), modified there, and then passed by value again to DownloadManager::OnPathExistenceAvailable(), where it is copied bach into DownloadItem. BUG=78084, 77188 TEST=Passes all download unit tests. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=86319

Patch Set 1 #

Patch Set 2 : Merged with part 1. #

Patch Set 3 : Merged with trunk. #

Patch Set 4 : Now tracking trunk. #

Patch Set 5 : Fixed stupid merge issues. #

Patch Set 6 : Fixed download browser test. #

Patch Set 7 : Fixed line endings. #

Patch Set 8 : Made the code for the download manager state more readable. #

Patch Set 9 : Removed structure accessors from DownloadItem, per request. #

Total comments: 2

Patch Set 10 : Merged with trunk. #

Patch Set 11 : Moved DownloadHistoryInfo to its own file. #

Patch Set 12 : Merged with trunk #

Total comments: 94

Patch Set 13 : Incorporated more comments. #

Patch Set 14 : Fixed compile bugs. #

Patch Set 15 : Removed spurious DCHECK. #

Total comments: 28

Patch Set 16 : Extracted DownloadStateInfo to its own files. #

Patch Set 17 : Added missing DownloadStateInfo.* files. #

Total comments: 10

Patch Set 18 : Removed the download ID and URL list (leaving 1) from DownloadHistoryItem. #

Total comments: 2

Patch Set 19 : Changed an early return to a DCHECK. #

Total comments: 2

Patch Set 20 : Fixed nits. #

Patch Set 21 : Fix for linux clang bots. #

Patch Set 22 : Stupid clang! #

Unified diffs Side-by-side diffs Delta from patch set Stats (+964 lines, -434 lines) Patch
M chrome/browser/automation/automation_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 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 5 chunks +7 lines, -7 lines 0 comments Download
A chrome/browser/download/download_create_info.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +118 lines, -0 lines 0 comments Download
A chrome/browser/download/download_create_info.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +78 lines, -0 lines 0 comments Download
M chrome/browser/download/download_file.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/download/download_file_manager.cc View 1 2 3 4 5 6 7 8 9 10 13 chunks +42 lines, -36 lines 0 comments Download
M chrome/browser/download/download_file_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/download/download_history.h View 2 chunks +2 lines, -3 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 3 chunks +8 lines, -5 lines 0 comments Download
M chrome/browser/download/download_item.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 13 chunks +67 lines, -48 lines 0 comments Download
M chrome/browser/download/download_item.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 24 chunks +93 lines, -85 lines 0 comments Download
M chrome/browser/download/download_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 8 chunks +26 lines, -11 lines 0 comments Download
M chrome/browser/download/download_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 19 chunks +205 lines, -119 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 10 chunks +15 lines, -16 lines 0 comments Download
M chrome/browser/download/download_safe_browsing_client.h View 1 4 chunks +2 lines, -7 lines 0 comments Download
M chrome/browser/download/download_safe_browsing_client.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +5 lines, -9 lines 0 comments Download
A chrome/browser/download/download_state_info.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +62 lines, -0 lines 0 comments Download
A chrome/browser/download/download_state_info.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +51 lines, -0 lines 0 comments Download
M chrome/browser/download/download_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +5 lines, -8 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 7 chunks +21 lines, -33 lines 0 comments Download
M chrome/browser/history/download_database.h View 4 chunks +4 lines, -4 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 5 chunks +6 lines, -6 lines 0 comments Download
A chrome/browser/history/download_history_info.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 +60 lines, -0 lines 0 comments Download
A chrome/browser/history/download_history_info.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +35 lines, -0 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 2 chunks +6 lines, -5 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 2 chunks +5 lines, -3 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 2 chunks +3 lines, -2 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 2 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/history/history_marshaling.h View 1 chunk +1 line, -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 3 chunks +10 lines, -4 lines 0 comments Download
M chrome/browser/renderer_host/download_resource_handler.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/browser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_item_controller.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/gtk/download/download_item_gtk.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +5 lines, -4 lines 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 14 15 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/chromeos/imageburner_ui.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +6 lines, -2 lines 0 comments Download

Messages

Total messages: 30 (0 generated)
ahendrickson
Here's the second CL for refactoring the downloads data flow!
9 years, 7 months ago (2011-05-12 20:25:40 UTC) #1
Paweł Hajdan Jr.
Sorry, I'm not convinced this is the right way (the split seems quite arbitrary). Do ...
9 years, 7 months ago (2011-05-13 08:47:20 UTC) #2
hendrickson_a
On 2011/05/13 08:47:20, Paweł Hajdan Jr. wrote: > Sorry, I'm not convinced this is the ...
9 years, 7 months ago (2011-05-13 13:50:29 UTC) #3
Randy Smith (Not in Mondays)
I'm in the tricky position of not caring a lot about the extra structures, but ...
9 years, 7 months ago (2011-05-16 19:50:54 UTC) #4
Paweł Hajdan Jr.
On 2011/05/16 19:50:54, rdsmith wrote: > The principles on which I'd like to base my ...
9 years, 7 months ago (2011-05-17 19:48:51 UTC) #5
Randy Smith (Not in Mondays)
On 2011/05/17 19:48:51, Paweł Hajdan Jr. wrote: > On 2011/05/16 19:50:54, rdsmith wrote: > > ...
9 years, 7 months ago (2011-05-17 20:06:51 UTC) #6
Paweł Hajdan Jr.
On 2011/05/17 20:06:51, rdsmith wrote: > So I think this is the key point, and ...
9 years, 7 months ago (2011-05-18 19:39:01 UTC) #7
Randy Smith (Not in Mondays)
I've just pinged you with a request to chat, as it's sounding like we're not ...
9 years, 7 months ago (2011-05-18 19:47:09 UTC) #8
ahendrickson
Removed DownloadRequestInfo, and updated per Randy's request. Randy, let me know if I forgot anything, ...
9 years, 7 months ago (2011-05-18 20:14:15 UTC) #9
Paweł Hajdan Jr.
I think it's going in a good direction. I won't be able to do a ...
9 years, 7 months ago (2011-05-18 20:20:32 UTC) #10
ahendrickson
Updated with Randy's suggestions.
9 years, 7 months ago (2011-05-18 23:17:51 UTC) #11
ahendrickson
Moved DownloadHistoryInfo to it's own set of files, and moved DownloadCreateInfo from chrome/browser/history to chrome/browser/download, ...
9 years, 7 months ago (2011-05-19 13:51:11 UTC) #12
ahendrickson
http://codereview.chromium.org/6969009/diff/16001/chrome/browser/history/download_create_info.h File chrome/browser/history/download_create_info.h (right): http://codereview.chromium.org/6969009/diff/16001/chrome/browser/history/download_create_info.h#newcode25 chrome/browser/history/download_create_info.h:25: struct DownloadHistoryInfo { On 2011/05/18 20:20:33, Paweł Hajdan Jr. ...
9 years, 7 months ago (2011-05-19 13:51:38 UTC) #13
Paweł Hajdan Jr.
http://codereview.chromium.org/6969009/diff/22009/chrome/browser/download/download_create_info.h File chrome/browser/download/download_create_info.h (right): http://codereview.chromium.org/6969009/diff/22009/chrome/browser/download/download_create_info.h#newcode5 chrome/browser/download/download_create_info.h:5: // Download creation struct used for querying the history ...
9 years, 7 months ago (2011-05-19 16:18:25 UTC) #14
Randy Smith (Not in Mondays)
http://codereview.chromium.org/6969009/diff/22009/chrome/browser/download/download_create_info.h File chrome/browser/download/download_create_info.h (right): http://codereview.chromium.org/6969009/diff/22009/chrome/browser/download/download_create_info.h#newcode1 chrome/browser/download/download_create_info.h:1: // Copyright (c) 2011 The Chromium Authors. All rights ...
9 years, 7 months ago (2011-05-19 17:05:27 UTC) #15
Paweł Hajdan Jr.
http://codereview.chromium.org/6969009/diff/22009/chrome/browser/download/download_manager.cc File chrome/browser/download/download_manager.cc (right): http://codereview.chromium.org/6969009/diff/22009/chrome/browser/download/download_manager.cc#newcode282 chrome/browser/download/download_manager.cc:282: DownloadItem::DownloadStateInfo state(*download); On 2011/05/19 17:05:27, rdsmith wrote: > On ...
9 years, 7 months ago (2011-05-19 19:11:24 UTC) #16
achuithb
http://codereview.chromium.org/6969009/diff/22009/chrome/browser/download/download_manager.cc File chrome/browser/download/download_manager.cc (right): http://codereview.chromium.org/6969009/diff/22009/chrome/browser/download/download_manager.cc#newcode479 chrome/browser/download/download_manager.cc:479: // |id_ptr| will be deleted in either FileSelected() or ...
9 years, 7 months ago (2011-05-19 19:47:36 UTC) #17
ahendrickson
http://codereview.chromium.org/6969009/diff/22009/chrome/browser/download/download_create_info.h File chrome/browser/download/download_create_info.h (right): http://codereview.chromium.org/6969009/diff/22009/chrome/browser/download/download_create_info.h#newcode1 chrome/browser/download/download_create_info.h:1: // Copyright (c) 2011 The Chromium Authors. All rights ...
9 years, 7 months ago (2011-05-19 20:16:49 UTC) #18
Paweł Hajdan Jr.
http://codereview.chromium.org/6969009/diff/22009/chrome/browser/download/download_create_info.h File chrome/browser/download/download_create_info.h (right): http://codereview.chromium.org/6969009/diff/22009/chrome/browser/download/download_create_info.h#newcode8 chrome/browser/download/download_create_info.h:8: #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ On 2011/05/19 20:16:49, ahendrickson wrote: > On ...
9 years, 7 months ago (2011-05-20 09:04:41 UTC) #19
ahendrickson
http://codereview.chromium.org/6969009/diff/22009/chrome/browser/download/download_item.h File chrome/browser/download/download_item.h (right): http://codereview.chromium.org/6969009/diff/22009/chrome/browser/download/download_item.h#newcode92 chrome/browser/download/download_item.h:92: struct DownloadStateInfo { On 2011/05/20 09:04:42, Paweł Hajdan Jr. ...
9 years, 7 months ago (2011-05-20 18:31:24 UTC) #20
Randy Smith (Not in Mondays)
Tossing this one comment out to reduce latency--about to do another full review. http://codereview.chromium.org/6969009/diff/22009/chrome/browser/history/download_history_info.h File ...
9 years, 7 months ago (2011-05-20 18:35:25 UTC) #21
Randy Smith (Not in Mondays)
Converging, hopefully not asymptotically :-}. http://codereview.chromium.org/6969009/diff/22009/chrome/browser/download/download_manager.cc File chrome/browser/download/download_manager.cc (right): http://codereview.chromium.org/6969009/diff/22009/chrome/browser/download/download_manager.cc#newcode1171 chrome/browser/download/download_manager.cc:1171: DCHECK(ContainsKey(active_downloads_, download_id)); On 2011/05/20 ...
9 years, 7 months ago (2011-05-20 19:49:29 UTC) #22
Randy Smith (Not in Mondays)
I can't find anything more to ask for changes in :-}. So: LGTM (with the ...
9 years, 7 months ago (2011-05-20 23:11:29 UTC) #23
ahendrickson
http://codereview.chromium.org/6969009/diff/28007/chrome/browser/download/download_manager.cc File chrome/browser/download/download_manager.cc (right): http://codereview.chromium.org/6969009/diff/28007/chrome/browser/download/download_manager.cc#newcode514 chrome/browser/download/download_manager.cc:514: return; On 2011/05/20 23:11:29, rdsmith wrote: > This routine ...
9 years, 7 months ago (2011-05-21 15:47:03 UTC) #24
Paweł Hajdan Jr.
LGTM Please make sure that the commit message is accurate and that you have all ...
9 years, 7 months ago (2011-05-23 14:04:23 UTC) #25
commit-bot: I haz the power
Try job failure for 6969009-23031 on linux_clang: http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_clang&number=1501
9 years, 7 months ago (2011-05-23 16:06:31 UTC) #26
commit-bot: I haz the power
Try job failure for 6969009-38001 on linux_clang: http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_clang&number=1507
9 years, 7 months ago (2011-05-23 17:40:20 UTC) #27
commit-bot: I haz the power
Change committed as 86319
9 years, 7 months ago (2011-05-23 19:15:04 UTC) #28
Peter Kasting
This change doesn't seem to have deleted download_xxx_info.* in chrome/browser/history/. Is that coming as a ...
9 years, 7 months ago (2011-05-24 00:58:25 UTC) #29
hendrickson_a
9 years, 7 months ago (2011-05-24 04:35:30 UTC) #30
Yeah, something broke with the CL mechanism, so I'm creating a new one to do
that.

Andy

On Mon, May 23, 2011 at 8:58 PM, <pkasting@chromium.org> wrote:

> This change doesn't seem to have deleted download_xxx_info.* in
> chrome/browser/history/.  Is that coming as a separate change?
>
>
> http://codereview.chromium.org/6969009/
>

Powered by Google App Engine
This is Rietveld 408576698