Index: components/history/core/browser/download_slice_info.h |
diff --git a/components/history/core/browser/download_slice_info.h b/components/history/core/browser/download_slice_info.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4af8efbc030806de23b38f68c98a6d0e4d7e058f |
--- /dev/null |
+++ b/components/history/core/browser/download_slice_info.h |
@@ -0,0 +1,40 @@ |
+// 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_SLICE_INFO_H_ |
+#define COMPONENTS_HISTORY_CORE_BROWSER_DOWNLOAD_SLICE_INFO_H_ |
+ |
+#include <stdint.h> |
+#include <string> |
+ |
+#include "components/history/core/browser/download_types.h" |
+ |
+namespace history { |
+ |
+// Contains the information for each slice of data that is written to the |
+// download target file. A download file can have multiple slices and cach |
+// slice will have a different offset. |
+struct DownloadSliceInfo { |
+ DownloadSliceInfo(); |
+ DownloadSliceInfo(DownloadId download_id, |
+ int64_t offset, |
+ int64_t received_bytes); |
+ DownloadSliceInfo(const DownloadSliceInfo& other); |
+ ~DownloadSliceInfo(); |
+ |
+ bool operator==(const DownloadSliceInfo&) const; |
+ |
+ // The id of the download in the database. |
+ DownloadId download_id; |
+ |
+ // Start position of the download request. |
+ int64_t offset; |
+ |
+ // The number of bytes received (so far). |
+ int64_t received_bytes; |
+}; |
+ |
+} // namespace history |
+ |
+#endif // COMPONENTS_HISTORY_CORE_BROWSER_DOWNLOAD_SLICE_INFO_H_ |