Index: content/browser/download/download_file_impl.h |
diff --git a/content/browser/download/download_file_impl.h b/content/browser/download/download_file_impl.h |
index 2ba3d8d058e27211d3eaefc32c9e177f511e67d1..bb84d79de78f636078f51ef38b209ceb72b967d0 100644 |
--- a/content/browser/download/download_file_impl.h |
+++ b/content/browser/download/download_file_impl.h |
@@ -68,7 +68,34 @@ class CONTENT_EXPORT DownloadFileImpl : virtual public DownloadFile { |
virtual DownloadInterruptReason AppendDataToFile( |
const char* data, size_t data_len); |
+ virtual base::TimeDelta GetRetryDelayForFailedRename(int attempt_number); |
+ |
+ virtual bool ShouldRetryFailedRename(DownloadInterruptReason reason); |
+ |
private: |
+ friend class DownloadFileTest; |
+ |
+ // Options for RenameWithRetryInternal. |
+ enum RenameOption { |
+ UNIQUIFY = 1 << 0, // If there's already a file on disk that conflicts with |
+ // |new_path|, try to create a unique file by appending |
+ // a uniquifier. |
+ ANNOTATE_WITH_SOURCE_INFORMATION = 1 << 1 |
+ }; |
+ |
+ // Rename file_ to |new_path|. |
+ // |option| specifies additional operations to be performed during the rename. |
+ // See RenameOptions above. |
Randy Smith (Not in Mondays)
2014/06/11 18:07:29
nit: No 's' (IMO).
asanka
2014/06/12 20:02:37
Done.
|
+ // |retries_left| indicates how many times to retry the operation if the |
+ // rename fails with a transient error. |
+ // |time_of_first_failure| should be empty when this method is called for the |
+ // first time. |
Randy Smith (Not in Mondays)
2014/06/11 18:07:29
If you just read the comment, you're left with the
asanka
2014/06/12 20:02:37
Reworded.
|
+ void RenameWithRetryInternal(const base::FilePath& new_path, |
+ RenameOption option, |
+ int retries_left, |
+ base::TimeTicks time_of_first_failure, |
+ const RenameCompletionCallback& callback); |
+ |
// Send an update on our progress. |
void SendUpdate(); |