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

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

Issue 7192016: chrome.experimental.downloads (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: DownloadQuery, single DownloadMap Created 9 years, 6 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 | « chrome/browser/download/download_item.h ('k') | chrome/browser/download/download_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_item.cc
diff --git a/chrome/browser/download/download_item.cc b/chrome/browser/download/download_item.cc
index 7f75dc19169707189890a634d6c9d5df4385b3ff..8a0945cdecf14880df9f962248d356bbdbcf6890 100644
--- a/chrome/browser/download/download_item.cc
+++ b/chrome/browser/download/download_item.cc
@@ -120,7 +120,7 @@ DownloadItem::DangerType GetDangerType(bool dangerous_file,
// Constructor for reading from the history service.
DownloadItem::DownloadItem(DownloadManager* download_manager,
const DownloadHistoryInfo& info)
- : download_id_(-1),
+ : download_id_(info.db_handle),
full_path_(info.path),
url_chain_(1, info.url),
referrer_url_(info.referrer_url),
@@ -129,7 +129,6 @@ DownloadItem::DownloadItem(DownloadManager* download_manager,
start_tick_(base::TimeTicks()),
state_(static_cast<DownloadState>(info.state)),
start_time_(info.start_time),
- db_handle_(info.db_handle),
download_manager_(download_manager),
is_paused_(false),
open_when_complete_(false),
@@ -171,7 +170,6 @@ DownloadItem::DownloadItem(DownloadManager* download_manager,
start_tick_(base::TimeTicks::Now()),
state_(IN_PROGRESS),
start_time_(info.start_time),
- db_handle_(DownloadHistory::kUninitializedHandle),
download_manager_(download_manager),
is_paused_(false),
open_when_complete_(false),
@@ -191,7 +189,7 @@ DownloadItem::DownloadItem(DownloadManager* download_manager,
const FilePath& path,
const GURL& url,
bool is_otr)
- : download_id_(1),
+ : download_id_(-1),
full_path_(path),
url_chain_(1, url),
referrer_url_(GURL()),
@@ -201,7 +199,6 @@ DownloadItem::DownloadItem(DownloadManager* download_manager,
start_tick_(base::TimeTicks::Now()),
state_(IN_PROGRESS),
start_time_(base::Time::Now()),
- db_handle_(DownloadHistory::kUninitializedHandle),
download_manager_(download_manager),
is_paused_(false),
open_when_complete_(false),
@@ -539,7 +536,7 @@ void DownloadItem::Remove() {
download_manager_->AssertQueueStateConsistent(this);
state_ = REMOVING;
- download_manager_->RemoveDownload(db_handle_);
+ download_manager_->RemoveDownload(id());
// We have now been deleted.
}
@@ -731,7 +728,7 @@ DownloadHistoryInfo DownloadItem::GetHistoryInfo() const {
received_bytes(),
total_bytes(),
state(),
- db_handle());
+ id());
}
FilePath DownloadItem::GetTargetFilePath() const {
@@ -815,7 +812,7 @@ std::string DownloadItem::DebugString(bool verbose) const {
if (verbose) {
description += base::StringPrintf(
- " db_handle = %" PRId64
+ " id = %" PRId32
" total_bytes = %" PRId64
" received_bytes = %" PRId64
" is_paused = %c"
@@ -825,7 +822,7 @@ std::string DownloadItem::DebugString(bool verbose) const {
" url_chain = \n\t\"%s\"\n\t"
" target_name = \"%" PRFilePath "\""
" full_path = \"%" PRFilePath "\"",
- db_handle(),
+ id(),
total_bytes(),
received_bytes(),
is_paused() ? 'T' : 'F',
« no previous file with comments | « chrome/browser/download/download_item.h ('k') | chrome/browser/download/download_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698