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..5f8ab80324981767680391275630c82b2cb8a801 |
--- /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 jobis associated with it, with each job having its own |
Scott Hess - ex-Googler
2017/02/06 21:22:16
probably s/jobis/job ids/ or something like.
qinmin
2017/02/06 23:39:22
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; |
+ |
+ // 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_ |