Commit bbb16e9e authored by Chris Mumford's avatar Chris Mumford Committed by Commit Bot

Use default DownloadSaveInfo move constructor.

Delete the explicit DownloadSaveInfo move constructor in favor of
using the default move constructor. This simplifies the code and
makes it less likely that a future additional member will be
overlooked.

Also initializing members in the declaration. This Simplifies
documentation and allows the default constructor to be used.

Bug: none
Change-Id: I6a5ccb895d074f13e7a5aaae6cabbec4d1e7809a
Reviewed-on: https://chromium-review.googlesource.com/1129214Reviewed-by: default avatarMin Qin <qinmin@chromium.org>
Commit-Queue: Chris Mumford <cmumford@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573463}
parent 6266d795
......@@ -9,19 +9,10 @@ namespace download {
// static
const int64_t DownloadSaveInfo::kLengthFullContent = 0;
DownloadSaveInfo::DownloadSaveInfo()
: offset(0), length(kLengthFullContent), prompt_for_save_location(false) {}
DownloadSaveInfo::DownloadSaveInfo() = default;
DownloadSaveInfo::~DownloadSaveInfo() {}
DownloadSaveInfo::~DownloadSaveInfo() = default;
DownloadSaveInfo::DownloadSaveInfo(DownloadSaveInfo&& that)
: file_path(std::move(that.file_path)),
suggested_name(std::move(that.suggested_name)),
file(std::move(that.file)),
offset(that.offset),
length(that.length),
hash_state(std::move(that.hash_state)),
hash_of_partial_file(std::move(that.hash_of_partial_file)),
prompt_for_save_location(that.prompt_for_save_location) {}
DownloadSaveInfo::DownloadSaveInfo(DownloadSaveInfo&& that) = default;
} // namespace download
......@@ -42,15 +42,14 @@ struct COMPONENTS_DOWNLOAD_EXPORT DownloadSaveInfo {
// If valid, contains the source data stream for the file contents.
base::File file;
// The file offset at which to start the download. May be 0.
int64_t offset;
// The file offset at which to start the download.
int64_t offset = 0;
// The number of the bytes to download from |offset|. Set to
// |kLengthFullContent| by default.
// The number of the bytes to download from |offset|.
// Ask to retrieve segment of the download file when length is greater than 0.
// Request the rest of the file starting from |offset|, when length is
// |kLengthFullContent|.
int64_t length;
int64_t length = kLengthFullContent;
// The state of the hash. If specified, this hash state must indicate the
// state of the partial file for the first |offset| bytes.
......@@ -66,8 +65,7 @@ struct COMPONENTS_DOWNLOAD_EXPORT DownloadSaveInfo {
// the user will be prompted for a location to save the download. Otherwise,
// the location will be determined automatically using |file_path| as a
// basis if |file_path| is not empty.
// |prompt_for_save_location| defaults to false.
bool prompt_for_save_location;
bool prompt_for_save_location = false;
private:
DISALLOW_COPY_AND_ASSIGN(DownloadSaveInfo);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment