Index: chrome/browser/download/download_item.cc |
diff --git a/chrome/browser/download/download_item.cc b/chrome/browser/download/download_item.cc |
index db8e0b804d600a52af40ef9badde2d9b2bd30931..a3d43f90d7d3b84ddfac74a4dc8faf565f0a2956 100644 |
--- a/chrome/browser/download/download_item.cc |
+++ b/chrome/browser/download/download_item.cc |
@@ -13,12 +13,12 @@ |
#include "base/stringprintf.h" |
#include "base/timer.h" |
#include "base/utf_string_conversions.h" |
-#include "net/base/net_util.h" |
#include "chrome/browser/download/download_create_info.h" |
#include "chrome/browser/download/download_crx_util.h" |
#include "chrome/browser/download/download_extensions.h" |
#include "chrome/browser/download/download_file_manager.h" |
#include "chrome/browser/download/download_history.h" |
+#include "chrome/browser/download/download_id.h" |
#include "chrome/browser/download/download_manager.h" |
#include "chrome/browser/download/download_prefs.h" |
#include "chrome/browser/download/download_state_info.h" |
@@ -33,6 +33,7 @@ |
#include "chrome/common/pref_names.h" |
#include "content/browser/browser_thread.h" |
#include "content/common/notification_source.h" |
+#include "net/base/net_util.h" |
#include "ui/base/l10n/l10n_util.h" |
// A DownloadItem normally goes through the following states: |
@@ -226,6 +227,10 @@ 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)); |
@@ -645,7 +650,7 @@ void DownloadItem::OnDownloadCompleting(DownloadFileManager* file_manager) { |
if (NeedsRename()) { |
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
NewRunnableMethod(file_manager, |
- &DownloadFileManager::RenameCompletingDownloadFile, id(), |
+ &DownloadFileManager::RenameCompletingDownloadFile, global_id(), |
GetTargetFilePath(), safety_state() == SAFE)); |
return; |
} |
@@ -653,9 +658,8 @@ void DownloadItem::OnDownloadCompleting(DownloadFileManager* file_manager) { |
DCHECK(!is_extension_install()); |
Completed(); |
- BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
- NewRunnableMethod(file_manager, &DownloadFileManager::CompleteDownload, |
- id())); |
+ BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, NewRunnableMethod( |
+ file_manager, &DownloadFileManager::CompleteDownload, global_id())); |
} |
void DownloadItem::OnDownloadRenamedToFinalName(const FilePath& full_path) { |