| Index: content/browser/download/download_file_manager.h
|
| ===================================================================
|
| --- content/browser/download/download_file_manager.h (revision 98659)
|
| +++ content/browser/download/download_file_manager.h (working copy)
|
| @@ -49,7 +49,6 @@
|
| #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;
|
| @@ -74,18 +73,21 @@
|
| // 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(DownloadId id, DownloadBuffer* buffer);
|
| + void UpdateDownload(int 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(DownloadId id,
|
| + void OnResponseCompleted(int id,
|
| DownloadBuffer* buffer,
|
| int os_error,
|
| const std::string& security_info);
|
| @@ -95,22 +97,22 @@
|
| // 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(DownloadId id);
|
| - void CompleteDownload(DownloadId id);
|
| + void CancelDownload(int id);
|
| + void CompleteDownload(int 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(DownloadId id, const FilePath& full_path);
|
| + void RenameInProgressDownloadFile(int 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(DownloadId id,
|
| + void RenameCompletingDownloadFile(int id,
|
| const FilePath& full_path,
|
| bool overwrite_existing_file);
|
|
|
| @@ -142,18 +144,21 @@
|
| bool hash_needed);
|
|
|
| // Called only on the download thread.
|
| - DownloadFile* GetDownloadFile(DownloadId id);
|
| + DownloadFile* GetDownloadFile(int id);
|
|
|
| // Called only from RenameInProgressDownloadFile and
|
| // RenameCompletingDownloadFile on the FILE thread.
|
| - void CancelDownloadOnRename(DownloadId id);
|
| + void CancelDownloadOnRename(int id);
|
|
|
| // Erases the download file with the given the download |id| and removes
|
| // it from the maps.
|
| - void EraseDownload(DownloadId id);
|
| + void EraseDownload(int id);
|
|
|
| - typedef base::hash_map<DownloadId, DownloadFile*> DownloadFileMap;
|
| + // Unique ID for each DownloadItem.
|
| + base::AtomicSequenceNumber next_id_;
|
|
|
| + typedef base::hash_map<int, DownloadFile*> DownloadFileMap;
|
| +
|
| // A map of all in progress downloads. It owns the download files.
|
| DownloadFileMap downloads_;
|
|
|
|
|