Chromium Code Reviews| Index: components/history/core/browser/download_job_info.h |
| diff --git a/components/history/core/browser/download_job_info.h b/components/history/core/browser/download_job_info.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ba73cfc3f027d4fb196961e28b6c78d3268ef2e4 |
| --- /dev/null |
| +++ b/components/history/core/browser/download_job_info.h |
| @@ -0,0 +1,58 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_HISTORY_CORE_BROWSER_DOWNLOAD_JOB_INFO_H_ |
| +#define COMPONENTS_HISTORY_CORE_BROWSER_DOWNLOAD_JOB_INFO_H_ |
| + |
| +#include <stdint.h> |
| +#include <string> |
| + |
| +#include "components/history/core/browser/download_types.h" |
| + |
| +namespace history { |
| + |
| +// Contains the download job information that is stored in the download |
| +// system's persistent store (or refers to it). Each download item can have |
| +// multiple download jobs associated with it, with each job having its own |
| +// start position. |
| +struct DownloadJobInfo { |
| + DownloadJobInfo(); |
| + DownloadJobInfo(DownloadId download_id, |
| + int job_id, |
| + int64_t start_position, |
| + int64_t length, |
| + int64_t received_bytes, |
| + DownloadState state, |
| + DownloadInterruptReason interrupt_reason); |
| + DownloadJobInfo(const DownloadJobInfo& other); |
| + ~DownloadJobInfo(); |
| + |
| + bool operator==(const DownloadJobInfo&) const; |
| + |
| + // The id of the download in the database. Not changed by UpdateDownload(). |
|
Scott Hess - ex-Googler
2017/02/08 22:01:40
"Not changed by UpdateDownload()" seem irrelevant.
qinmin
2017/02/09 01:01:42
removed
|
| + DownloadId download_id; |
| + |
| + // Job id of the download. |
| + int job_id; |
|
Scott Hess - ex-Googler
2017/02/08 22:01:40
AFAICT, this CL isn't wired in to anything, so I c
qinmin
2017/02/09 01:01:42
Using start position might not be enough. For exam
asanka
2017/02/09 02:19:47
I think it's worth fleshing out how you are going
|
| + |
| + // Start position of the download request. |
| + int64_t start_position; |
| + |
| + // Data length to download. If length < 0, download should continue until |
| + // the stream reaches the end. |
| + int64_t length; |
| + |
| + // The number of bytes received (so far). |
| + int64_t received_bytes; |
| + |
| + // The current state of the download. |
| + DownloadState state; |
| + |
| + // The reason the download was interrupted, if state == kStateInterrupted. |
| + DownloadInterruptReason interrupt_reason; |
| +}; |
| + |
| +} // namespace history |
| + |
| +#endif // COMPONENTS_HISTORY_CORE_BROWSER_DOWNLOAD_JOB_INFO_H_ |