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

Issue 3245005: GTTF: Clean up DownloadFileManager (Closed)

Created:
10 years, 3 months ago by Paweł Hajdan Jr.
Modified:
9 years, 7 months ago
CC:
chromium-reviews, brettw-cc_chromium.org, Paweł Hajdan Jr., Paul Godavari, darin-cc_chromium.org, ben+cc_chromium.org
Visibility:
Public.

Description

GTTF: Clean up DownloadFileManager This removes a lot of duplication, locking, and thread jumping. Most of the operations run on the FILE thread, and we do not duplicate so much information. Each DownloadFile keeps track of its DownloadManager (each Profile has its own DownloadManager). This allows us to remove many maps from DownloadFileManager that were duplicating that information. There is still SaveFileManager, but hopefully I will be able to merge those two in small steps. TEST=unit_tests, browser_tests, ui_tests BUG=48913 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=58196

Patch Set 1 #

Total comments: 4

Patch Set 2 : fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -256 lines) Patch
M chrome/browser/download/base_file.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/download/base_file.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/download/base_file_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/download/download_file.h View 4 chunks +10 lines, -1 line 0 comments Download
M chrome/browser/download/download_file.cc View 2 chunks +16 lines, -2 lines 0 comments Download
M chrome/browser/download/download_file_manager.h View 4 chunks +11 lines, -35 lines 0 comments Download
M chrome/browser/download/download_file_manager.cc View 1 12 chunks +80 lines, -208 lines 0 comments Download
M chrome/browser/download/download_manager.cc View 2 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/download/download_manager_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/download/save_file.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/renderer_host/download_resource_handler.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
Paweł Hajdan Jr.
10 years, 3 months ago (2010-08-27 23:32:13 UTC) #1
darin (slow to review)
LGTM http://codereview.chromium.org/3245005/diff/1/7 File chrome/browser/download/download_file_manager.cc (right): http://codereview.chromium.org/3245005/diff/1/7#newcode38 chrome/browser/download/download_file_manager.cc:38: DownloadManager* DownloadManagerFromRenderIds(int render_process_id, nit: Ids -> IDs you ...
10 years, 3 months ago (2010-08-28 06:13:32 UTC) #2
ahendrickson
LGTM. I'd like to see a comment to the effect that download managers are now ...
10 years, 3 months ago (2010-08-28 17:37:35 UTC) #3
Bernhard Bauer
10 years, 3 months ago (2010-08-30 12:25:07 UTC) #4
some smallish things below, otherwise LGTM.

http://codereview.chromium.org/3245005/diff/1/7
File chrome/browser/download/download_file_manager.cc (right):

http://codereview.chromium.org/3245005/diff/1/7#newcode81
chrome/browser/download/download_file_manager.cc:81: DownloadFile* download_file
= new DownloadFile(info, download_manager);
Could you use a scoped_ptr here...

http://codereview.chromium.org/3245005/diff/1/7#newcode95
chrome/browser/download/download_file_manager.cc:95:
downloads_[info->download_id] = download_file;
...and call release() on it here?

http://codereview.chromium.org/3245005/diff/1/7#newcode203
chrome/browser/download/download_file_manager.cc:203: ChromeThread::UI,
FROM_HERE,
Nit: I think there was a thread on chromium-dev recently about using separate
lines for function arguments, but personally I don't mind this style. Use your
judgement.

Powered by Google App Engine
This is Rietveld 408576698