Index: chrome/browser/download/download_manager.cc |
=================================================================== |
--- chrome/browser/download/download_manager.cc (revision 72714) |
+++ chrome/browser/download/download_manager.cc (working copy) |
@@ -831,6 +831,14 @@ |
#if !defined(NDEBUG) |
save_page_as_downloads_.insert(download_item); |
#endif |
+ // Assign a fake db handle if it is uninitialized. The history cannot hold |
+ // multiple DownloadItems with the same handle. |
+ int64 db_handle = download_item->db_handle(); |
+ if (db_handle == DownloadHistory::kUninitializedHandle) |
+ db_handle = download_history_->GetNextFakeDbHandle(); |
+ download_item->set_db_handle(db_handle); |
Paweł Hajdan Jr.
2011/01/31 08:32:19
nit: Could you put it inside the "if"?
|
+ |
+ history_downloads_[download_item->db_handle()] = download_item; |
Paweł Hajdan Jr.
2011/01/31 08:32:19
nit: Should be sufficient to just use db_handle he
|
downloads_.insert(download_item); |
} |