|
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
Total comments: 24
Total comments: 6
Total comments: 4
Total comments: 2
|
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
|
Total messages: 16 (0 generated)
|