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

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

Issue 7237034: sql::MetaTable.next_download_id, DownloadManager::GetNextId() (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: MSVC requires operator< for hash_map Created 9 years, 4 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: 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) {

Powered by Google App Engine
This is Rietveld 408576698