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

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: fix ifndefs 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
« no previous file with comments | « content/browser/download/download_item.h ('k') | content/browser/download/download_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_item.cc
diff --git a/content/browser/download/download_item.cc b/content/browser/download/download_item.cc
index bf64aaecf53ea0ccd026dfa9a5b7dcfb1ee251e1..0913569c471811ff89a5d92c50d3cb9b2132f8cf 100644
--- a/content/browser/download/download_item.cc
+++ b/content/browser/download/download_item.cc
@@ -124,7 +124,7 @@ const int DownloadItem::kUninitializedHandle = 0;
// Constructor for reading from the history service.
DownloadItem::DownloadItem(DownloadManager* download_manager,
const DownloadPersistentStoreInfo& info)
- : download_id_(-1),
+ : download_id_(download_manager->GetNextId()),
full_path_(info.path),
url_chain_(1, info.url),
referrer_url_(info.referrer_url),
@@ -201,7 +201,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()),
@@ -235,10 +235,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));
@@ -777,7 +773,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.
« no previous file with comments | « content/browser/download/download_item.h ('k') | content/browser/download/download_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698