Chromium Code Reviews| Index: components/history/core/browser/download_job_info.cc |
| diff --git a/components/history/core/browser/download_job_info.cc b/components/history/core/browser/download_job_info.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6387650a741db2c196eb28507f23189653f78e0b |
| --- /dev/null |
| +++ b/components/history/core/browser/download_job_info.cc |
| @@ -0,0 +1,46 @@ |
| +// Copyright (c) 2017 The Chromium Authors. All rights reserved. |
|
sky
2017/02/03 16:02:34
no (c)
qinmin
2017/02/04 00:06:56
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "components/history/core/browser/download_job_info.h" |
| + |
| +#include "components/history/core/browser/download_constants.h" |
| + |
| +namespace history { |
| + |
| +DownloadJobInfo::DownloadJobInfo() |
| + : download_id(0), |
|
sky
2017/02/03 16:02:34
kInvalidDownloadId?
qinmin
2017/02/04 00:06:56
Done.
|
| + start_position(0), |
| + length(0), |
| + received_bytes(0), |
| + state(DownloadState::IN_PROGRESS), |
|
sky
2017/02/03 16:02:34
You sure you don't want interrupted?
qinmin
2017/02/04 00:06:56
When a job is created, it should always in the sta
|
| + interrupt_reason(0) {} |
| + |
| +DownloadJobInfo::DownloadJobInfo(DownloadId download_id, |
| + int job_id, |
| + int64_t start_position, |
| + int64_t length, |
| + int64_t received_bytes, |
| + DownloadState state, |
| + DownloadInterruptReason interrupt_reason) |
| + : download_id(download_id), |
| + job_id(job_id), |
| + start_position(start_position), |
| + length(length), |
| + received_bytes(received_bytes), |
| + state(state), |
| + interrupt_reason(interrupt_reason) {} |
| + |
| +DownloadJobInfo::DownloadJobInfo(const DownloadJobInfo& other) = default; |
| + |
| +DownloadJobInfo::~DownloadJobInfo() = default; |
| + |
| +bool DownloadJobInfo::operator==(const DownloadJobInfo& rhs) const { |
| + return download_id == rhs.download_id && job_id == rhs.job_id && |
| + start_position == rhs.start_position && |
| + length == rhs.length && |
| + received_bytes == rhs.received_bytes && state == rhs.state && |
| + interrupt_reason == rhs.interrupt_reason; |
| +} |
| + |
| +} // namespace history |