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..3b9efbc3d72eea322aee09ca7f2d890ceb27bf00 |
| --- /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 job associated with it, with each job has its own |
|
sky
2017/02/03 16:02:34
'download job' -> 'download jobs'
'job has' -> ;jo
qinmin
2017/02/04 00:06:56
Done.
|
| +// 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; |
|
sky
2017/02/03 16:02:34
Do you have test coverage of this?
qinmin
2017/02/04 00:06:56
added download_job_info_unittest.cc to test this
|
| + |
| + // The id of the download in the database. Not changed by UpdateDownload(). |
| + DownloadId download_id; |
| + |
| + // Job id of the download. |
| + int job_id; |
| + |
| + // 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_ |