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

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

Issue 11363222: Persist download interrupt reason, both target and current paths, and url_chain. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed ordering of target_path and current_path everywhere to match that of DownloadItemImpl. Created 8 years 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_manager_impl.cc
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc
index 557c3b6b099e735fa0d7d1576ec2f898712a123d..84a669fe9e6a67d9a0e3f6ae782786e883ede126 100644
--- a/content/browser/download/download_manager_impl.cc
+++ b/content/browser/download/download_manager_impl.cc
@@ -143,27 +143,31 @@ class DownloadItemFactoryImpl : public DownloadItemFactory {
virtual DownloadItemImpl* CreatePersistedItem(
DownloadItemImplDelegate* delegate,
DownloadId download_id,
- const FilePath& path,
- const GURL& url,
+ const FilePath& current_path,
+ const FilePath& target_path,
+ const std::vector<GURL>& url_chain,
const GURL& referrer_url,
const base::Time& start_time,
const base::Time& end_time,
int64 received_bytes,
int64 total_bytes,
DownloadItem::DownloadState state,
+ DownloadInterruptReason interrupt_reason,
bool opened,
const net::BoundNetLog& bound_net_log) OVERRIDE {
return new DownloadItemImpl(
delegate,
download_id,
- path,
- url,
+ current_path,
+ target_path,
+ url_chain,
referrer_url,
start_time,
end_time,
received_bytes,
total_bytes,
state,
+ interrupt_reason,
opened,
bound_net_log);
}
@@ -352,7 +356,7 @@ DownloadItem* DownloadManagerImpl::StartDownload(
// DownloadItem already needs to handle a state in which there is
// no associated DownloadFile (history downloads, !IN_PROGRESS downloads)
DownloadItemImpl* download =
- CreateDownloadItem(info.get(), bound_net_log);
+ CreateDownloadItemInternal(info.get(), bound_net_log);
scoped_ptr<DownloadFile> download_file(
file_factory_->CreateFile(
info->save_info.Pass(), default_download_directory,
@@ -412,7 +416,7 @@ BrowserContext* DownloadManagerImpl::GetBrowserContext() const {
return browser_context_;
}
-DownloadItemImpl* DownloadManagerImpl::CreateDownloadItem(
+DownloadItemImpl* DownloadManagerImpl::CreateDownloadItemInternal(
DownloadCreateInfo* info, const net::BoundNetLog& bound_net_log) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -554,26 +558,30 @@ void DownloadManagerImpl::RemoveObserver(Observer* observer) {
}
DownloadItem* DownloadManagerImpl::CreateDownloadItem(
- const FilePath& path,
- const GURL& url,
+ const FilePath& current_path,
+ const FilePath& target_path,
+ const std::vector<GURL>& url_chain,
const GURL& referrer_url,
const base::Time& start_time,
const base::Time& end_time,
int64 received_bytes,
int64 total_bytes,
DownloadItem::DownloadState state,
+ DownloadInterruptReason interrupt_reason,
bool opened) {
DownloadItemImpl* item = item_factory_->CreatePersistedItem(
this,
GetNextId(),
- path,
- url,
+ current_path,
+ target_path,
+ url_chain,
referrer_url,
start_time,
end_time,
received_bytes,
total_bytes,
state,
+ interrupt_reason,
opened,
net::BoundNetLog::Make(net_log_, net::NetLog::SOURCE_DOWNLOAD));
DCHECK(!ContainsKey(downloads_, item->GetId()));

Powered by Google App Engine
This is Rietveld 408576698