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

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

Issue 8401001: Fix history importing by delaying DownloadManager creation. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: " Created 9 years, 2 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
Index: content/browser/download/download_item.cc
diff --git a/content/browser/download/download_item.cc b/content/browser/download/download_item.cc
index 84387b667353a3727d369273445e656fed360f2b..8c767e6bbff0498e4c793618fc5cc3ddd0b403b9 100644
--- a/content/browser/download/download_item.cc
+++ b/content/browser/download/download_item.cc
@@ -120,8 +120,9 @@ const int DownloadItem::kUninitializedHandle = 0;
// Constructor for reading from the history service.
DownloadItem::DownloadItem(DownloadManager* download_manager,
- const DownloadPersistentStoreInfo& info)
- : download_id_(-1),
+ const DownloadPersistentStoreInfo& info,
+ const DownloadId& download_id)
+ : download_id_(download_id),
full_path_(info.path),
url_chain_(1, info.url),
referrer_url_(info.referrer_url),
@@ -198,7 +199,7 @@ DownloadItem::DownloadItem(DownloadManager* download_manager,
const GURL& url,
bool is_otr,
DownloadId download_id)
- : download_id_(download_id.local()),
+ : download_id_(download_id),
full_path_(path),
url_chain_(1, url),
referrer_url_(GURL()),
@@ -232,10 +233,6 @@ DownloadItem::~DownloadItem() {
download_manager_->AssertQueueStateConsistent(this);
}
-DownloadId DownloadItem::global_id() const {
- return DownloadId(download_manager_, id());
-}
-
void DownloadItem::AddObserver(Observer* observer) {
// TODO(rdsmith): Change to DCHECK after http://crbug.com/85408 resolved.
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -774,7 +771,7 @@ std::string DownloadItem::DebugString(bool verbose) const {
std::string description =
base::StringPrintf("{ id = %d"
" state = %s",
- download_id_,
+ download_id_.local(),
DebugDownloadStateString(state()));
// Construct a string of the URL chain.

Powered by Google App Engine
This is Rietveld 408576698