| Index: chrome/browser/download/download_path_reservation_tracker.h
|
| diff --git a/chrome/browser/download/download_path_reservation_tracker.h b/chrome/browser/download/download_path_reservation_tracker.h
|
| index 494253d5188d0ce44ecc1c9d0b8974b926949f25..673e629c77752f48c42093d0e2eb03554d17c74f 100644
|
| --- a/chrome/browser/download/download_path_reservation_tracker.h
|
| +++ b/chrome/browser/download/download_path_reservation_tracker.h
|
| @@ -15,6 +15,13 @@ namespace content {
|
| class DownloadItem;
|
| }
|
|
|
| +enum class PathValidationResult {
|
| + SUCCESS,
|
| + PATH_NOT_WRITABLE,
|
| + NAME_TOO_LONG,
|
| + CONFLICT
|
| +};
|
| +
|
| // Chrome attempts to uniquify filenames that are assigned to downloads in order
|
| // to avoid overwriting files that already exist on the file system. Downloads
|
| // that are considered potentially dangerous use random intermediate filenames.
|
| @@ -24,16 +31,16 @@ class DownloadItem;
|
| class DownloadPathReservationTracker {
|
| public:
|
| // Callback used with |GetReservedPath|. |target_path| specifies the target
|
| - // path for the download. |target_path_verified| is true if all of the
|
| - // following is true:
|
| + // path for the download. If |result| is SUCCESS then:
|
| // - |requested_target_path| (passed into GetReservedPath()) was writeable.
|
| // - |target_path| was verified as being unique if uniqueness was
|
| // required.
|
| //
|
| // If |requested_target_path| was not writeable, then the parent directory of
|
| // |target_path| may be different from that of |requested_target_path|.
|
| - typedef base::Callback<void(const base::FilePath& target_path,
|
| - bool target_path_verified)> ReservedPathCallback;
|
| + using ReservedPathCallback =
|
| + base::Callback<void(PathValidationResult result,
|
| + const base::FilePath& target_path)>;
|
|
|
| // The largest index for the uniquification suffix that we will try while
|
| // attempting to come up with a unique path.
|
|
|