| 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..bfede58cc8673a58640295990420a2508300f0e9
|
| --- /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
|
| +// start position.
|
| +struct DownloadJobInfo {
|
| + DownloadJobInfo();
|
| + DownloadJobInfo(DownloadId 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().
|
| + DownloadId 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_
|
|
|