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

Unified Diff: content/browser/download/download_file_manager.h

Issue 7237034: sql::MetaTable.next_download_id, DownloadManager::GetNextId() (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fix merge 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
« no previous file with comments | « chrome/browser/profiles/profile_io_data.cc ('k') | content/browser/download/download_file_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_file_manager.h
diff --git a/content/browser/download/download_file_manager.h b/content/browser/download/download_file_manager.h
index 0c14dca6524cfdd27e26e7fe97448017d6f71e07..d7e62f08f3563d8630ba8959477e57fdb9478110 100644
--- a/content/browser/download/download_file_manager.h
+++ b/content/browser/download/download_file_manager.h
@@ -49,6 +49,7 @@
#include "base/memory/ref_counted.h"
#include "base/timer.h"
#include "content/browser/download/download_request_handle.h"
+#include "content/browser/download/download_id.h"
#include "ui/gfx/native_widget_types.h"
struct DownloadBuffer;
@@ -73,21 +74,18 @@ class DownloadFileManager
// Called on shutdown on the UI thread.
void Shutdown();
- // Called on the IO or UI threads.
- int GetNextId();
-
// Called on UI thread to make DownloadFileManager start the download.
void StartDownload(DownloadCreateInfo* info);
// Handlers for notifications sent from the IO thread and run on the
// FILE thread.
- void UpdateDownload(int id, DownloadBuffer* buffer);
+ void UpdateDownload(DownloadId id, DownloadBuffer* buffer);
// |os_error| is 0 for normal completions, and non-0 for errors.
// |security_info| contains SSL information (cert_id, cert_status,
// security_bits, ssl_connection_status), which can be used to
// fine-tune the error message. It is empty if the transaction
// was not performed securely.
- void OnResponseCompleted(int id,
+ void OnResponseCompleted(DownloadId id,
DownloadBuffer* buffer,
int os_error,
const std::string& security_info);
@@ -97,22 +95,22 @@ class DownloadFileManager
// download file, as far as the DownloadFileManager is concerned -- if
// anything happens to the download file after they are called, it will
// be ignored.
- void CancelDownload(int id);
- void CompleteDownload(int id);
+ void CancelDownload(DownloadId id);
+ void CompleteDownload(DownloadId id);
// Called on FILE thread by DownloadManager at the beginning of its shutdown.
void OnDownloadManagerShutdown(DownloadManager* manager);
// The DownloadManager in the UI thread has provided an intermediate
// .crdownload name for the download specified by |id|.
- void RenameInProgressDownloadFile(int id, const FilePath& full_path);
+ void RenameInProgressDownloadFile(DownloadId id, const FilePath& full_path);
// The DownloadManager in the UI thread has provided a final name for the
// download specified by |id|.
// |overwrite_existing_file| prevents uniquification, and is used for SAFE
// downloads, as the user may have decided to overwrite the file.
// Sent from the UI thread and run on the FILE thread.
- void RenameCompletingDownloadFile(int id,
+ void RenameCompletingDownloadFile(DownloadId id,
const FilePath& full_path,
bool overwrite_existing_file);
@@ -144,20 +142,17 @@ class DownloadFileManager
bool hash_needed);
// Called only on the download thread.
- DownloadFile* GetDownloadFile(int id);
+ DownloadFile* GetDownloadFile(DownloadId id);
// Called only from RenameInProgressDownloadFile and
// RenameCompletingDownloadFile on the FILE thread.
- void CancelDownloadOnRename(int id);
+ void CancelDownloadOnRename(DownloadId id);
// Erases the download file with the given the download |id| and removes
// it from the maps.
- void EraseDownload(int id);
-
- // Unique ID for each DownloadItem.
- base::AtomicSequenceNumber next_id_;
+ void EraseDownload(DownloadId id);
- typedef base::hash_map<int, DownloadFile*> DownloadFileMap;
+ typedef base::hash_map<DownloadId, DownloadFile*> DownloadFileMap;
// A map of all in progress downloads. It owns the download files.
DownloadFileMap downloads_;
« no previous file with comments | « chrome/browser/profiles/profile_io_data.cc ('k') | content/browser/download/download_file_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698