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

Unified Diff: chrome/browser/download/download_manager.cc

Issue 6312027: Add files saved using 'Save page as' to the download history.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698