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

Issue 8401001: Fix history importing by delaying DownloadManager creation. (Closed)

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

Description

Fix history importing by delaying DownloadManager creation. Replace GetNextIdThunkType with DownloadIdFactory (RefCountedThreadSafe, created by DownloadService). DownloadService uses the same DownloadIdFactory for an OTR profile as its original profile. DownloadService passes the DownloadIdFactory into the DownloadManager so that the DownloadManager can allocate new valid ids for items loaded from the history or downloads started on the ui thread. Since the DownloadService precedes and outlives its DownloadManager, DownloadManager does not have a scoped_refptr<DownloadIdFactory>. Objects that do have a scoped_refptr<DownloadIdFactory>: DownloadService, ProfileIOData, ShellBrowserContext, ShellResourceContext. The DownloadIdFactory must be RefCountedThreadSafe because ProfileIOData outlives Profile and because it's used in both the OTR and original profiles. Longer term, the import process should strictly precede profile initialization, and the next_download_id counter should be loaded from the History db strictly before DownloadService is created and creates a DownloadIdFactory. BUG=98966 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=107836

Patch Set 1 : " #

Total comments: 24

Patch Set 2 : alpha, bugfix #

Total comments: 6

Patch Set 3 : comments #

Total comments: 4

Patch Set 4 : merge #

Patch Set 5 : merge #

Patch Set 6 : merge #

Total comments: 2

Patch Set 7 : fix ifndefs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+229 lines, -161 lines) Patch
M chrome/browser/download/chrome_download_manager_delegate.cc View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/download/download_manager_unittest.cc View 1 2 3 21 chunks +29 lines, -22 lines 0 comments Download
M chrome/browser/download/download_service.h View 3 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/download/download_service.cc View 1 2 2 chunks +16 lines, -2 lines 0 comments Download
M chrome/browser/profiles/profile_io_data.h View 1 2 3 4 5 4 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/profiles/profile_io_data.cc View 1 2 3 4 5 4 chunks +6 lines, -2 lines 0 comments Download
M content/browser/download/download_create_info.h View 3 chunks +3 lines, -2 lines 0 comments Download
M content/browser/download/download_create_info.cc View 1 2 3 chunks +4 lines, -4 lines 0 comments Download
M content/browser/download/download_file.h View 3 chunks +4 lines, -2 lines 0 comments Download
M content/browser/download/download_file.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/browser/download/download_file_manager.cc View 1 2 3 4 5 3 chunks +4 lines, -5 lines 0 comments Download
M content/browser/download/download_file_unittest.cc View 1 2 3 6 chunks +10 lines, -2 lines 0 comments Download
M content/browser/download/download_id.h View 1 2 3 4 5 6 4 chunks +19 lines, -20 lines 0 comments Download
M content/browser/download/download_id.cc View 1 2 1 chunk +8 lines, -1 line 0 comments Download
A content/browser/download/download_id_factory.h View 1 2 3 4 5 6 1 chunk +33 lines, -0 lines 0 comments Download
A content/browser/download/download_id_factory.cc View 1 2 1 chunk +17 lines, -0 lines 0 comments Download
M content/browser/download/download_id_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/browser/download/download_item.h View 1 2 3 chunks +4 lines, -3 lines 0 comments Download
M content/browser/download/download_item.cc View 1 2 3 4 5 4 chunks +3 lines, -7 lines 0 comments Download
M content/browser/download/download_manager.h View 1 2 3 8 chunks +7 lines, -26 lines 0 comments Download
M content/browser/download/download_manager.cc View 1 2 3 4 5 6 5 chunks +8 lines, -26 lines 0 comments Download
M content/browser/download/download_resource_handler.cc View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/download/mock_download_manager.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/download/save_package.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/buffered_resource_handler.cc View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host.cc View 3 chunks +3 lines, -2 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host_unittest.cc View 1 2 3 3 chunks +9 lines, -4 lines 0 comments Download
M content/browser/resource_context.h View 3 chunks +4 lines, -6 lines 0 comments Download
M content/browser/resource_context.cc View 1 2 3 1 chunk +5 lines, -6 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M content/shell/shell_browser_context.h View 2 chunks +2 lines, -0 lines 0 comments Download
M content/shell/shell_browser_context.cc View 1 2 3 4 chunks +5 lines, -2 lines 0 comments Download
M content/shell/shell_resource_context.h View 3 chunks +3 lines, -3 lines 0 comments Download
M content/shell/shell_resource_context.cc View 1 3 chunks +4 lines, -3 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
benjhayden
Ready for review while I work on making all the tests delete the DIF on ...
9 years, 1 month ago (2011-10-27 15:45:02 UTC) #1
Miranda Callahan
On 2011/10/27 15:45:02, b s h wrote: > Ready for review while I work on ...
9 years, 1 month ago (2011-10-27 16:55:04 UTC) #2
Miranda Callahan
(some alphabetization nits I noticed while reading through the change.) http://codereview.chromium.org/8401001/diff/8001/content/browser/download/download_item.h File content/browser/download/download_item.h (right): http://codereview.chromium.org/8401001/diff/8001/content/browser/download/download_item.h#newcode29 ...
9 years, 1 month ago (2011-10-27 17:00:19 UTC) #3
Randy Smith (Not in Mondays)
I'd appreciate it if you could change the description so that the first line (preferably ...
9 years, 1 month ago (2011-10-27 18:01:44 UTC) #4
benjhayden
http://codereview.chromium.org/8401001/diff/8001/chrome/browser/download/download_service.cc File chrome/browser/download/download_service.cc (right): http://codereview.chromium.org/8401001/diff/8001/chrome/browser/download/download_service.cc#newcode40 chrome/browser/download/download_service.cc:40: GetDownloadIdFactory(), On 2011/10/27 18:01:44, rdsmith wrote: > nit, suggestion: ...
9 years, 1 month ago (2011-10-27 19:04:40 UTC) #5
benjhayden
Sorry, I forgot to change the issue title.
9 years, 1 month ago (2011-10-27 21:02:39 UTC) #6
Randy Smith (Not in Mondays)
LGTM; none of the below comments are gating. Thanks for throwing this together so quickly! ...
9 years, 1 month ago (2011-10-28 13:35:43 UTC) #7
benjhayden
Waiting for try-bots to catch up. http://codereview.chromium.org/8401001/diff/8001/content/browser/download/download_id_factory.h File content/browser/download/download_id_factory.h (right): http://codereview.chromium.org/8401001/diff/8001/content/browser/download/download_id_factory.h#newcode23 content/browser/download/download_id_factory.h:23: void SetNextId(int next_id); ...
9 years, 1 month ago (2011-10-28 14:37:54 UTC) #8
benjhayden
PS5 is at revision 107766.
9 years, 1 month ago (2011-10-28 19:16:56 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/benjhayden@chromium.org/8401001/18108
9 years, 1 month ago (2011-10-28 21:55:53 UTC) #10
commit-bot: I haz the power
Presubmit check for 8401001-18108 failed and returned exit status 1. Running presubmit commit checks ...
9 years, 1 month ago (2011-10-28 21:56:05 UTC) #11
jam
lgtm http://codereview.chromium.org/8401001/diff/18108/content/browser/download/download_id_factory.h File content/browser/download/download_id_factory.h (right): http://codereview.chromium.org/8401001/diff/18108/content/browser/download/download_id_factory.h#newcode5 content/browser/download/download_id_factory.h:5: #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ID_FACTORY_H_ nit: CONTENT
9 years, 1 month ago (2011-10-28 22:24:55 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/benjhayden@chromium.org/8401001/8039
9 years, 1 month ago (2011-10-28 22:37:55 UTC) #13
benjhayden
Thank you! http://codereview.chromium.org/8401001/diff/18108/content/browser/download/download_id_factory.h File content/browser/download/download_id_factory.h (right): http://codereview.chromium.org/8401001/diff/18108/content/browser/download/download_id_factory.h#newcode5 content/browser/download/download_id_factory.h:5: #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ID_FACTORY_H_ On 2011/10/28 22:24:56, John Abd-El-Malek ...
9 years, 1 month ago (2011-10-28 22:39:08 UTC) #14
benjhayden
Looks like the tree is closed? And the CQ skipped mac_rel? But the CQ hasn't ...
9 years, 1 month ago (2011-10-29 00:21:24 UTC) #15
commit-bot: I haz the power
9 years, 1 month ago (2011-10-29 00:46:55 UTC) #16
Change committed as 107836

Powered by Google App Engine
This is Rietveld 408576698