diff options
author | Primiano Tucci <primiano@google.com> | 2014-09-30 14:45:55 +0100 |
---|---|---|
committer | Primiano Tucci <primiano@google.com> | 2014-09-30 14:45:55 +0100 |
commit | 1320f92c476a1ad9d19dba2a48c72b75566198e9 (patch) | |
tree | ea7f149ccad687b22c18a72b729646568b2d54fb /content/browser/download/download_file_impl.h | |
parent | 39b78c562f50ad7d5551ee861121f899239525a2 (diff) | |
download | chromium_org-1320f92c476a1ad9d19dba2a48c72b75566198e9.tar.gz |
Merge from Chromium at DEPS revision 267aeeb8d85c
This commit was generated by merge_to_master.py.
Change-Id: Id3aac9713b301fae64408cdaee0888724eeb7c0e
Diffstat (limited to 'content/browser/download/download_file_impl.h')
-rw-r--r-- | content/browser/download/download_file_impl.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/content/browser/download/download_file_impl.h b/content/browser/download/download_file_impl.h index 2ba3d8d058..f7950eec2e 100644 --- a/content/browser/download/download_file_impl.h +++ b/content/browser/download/download_file_impl.h @@ -68,7 +68,36 @@ 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 RenameOption above. + // |retries_left| indicates how many times to retry the operation if the + // rename fails with a transient error. + // |time_of_first_failure| Set to an empty base::TimeTicks during the first + // call. Once the first failure is seen, subsequent calls of + // RenameWithRetryInternal will have a non-empty value keeping track of + // the time of first observed failure. Used for UMA. + 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(); |