OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_DOWNLOAD_SLICE_INFO_H_ |
| 6 #define COMPONENTS_HISTORY_CORE_BROWSER_DOWNLOAD_SLICE_INFO_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 #include <string> |
| 10 |
| 11 #include "components/history/core/browser/download_types.h" |
| 12 |
| 13 namespace history { |
| 14 |
| 15 // Contains the information for each slice of data that is written to the |
| 16 // download target file. A download file can have multiple slices and cach |
| 17 // slice will have a different offset. |
| 18 struct DownloadSliceInfo { |
| 19 DownloadSliceInfo(); |
| 20 DownloadSliceInfo(DownloadId download_id, |
| 21 int64_t offset, |
| 22 int64_t received_bytes); |
| 23 DownloadSliceInfo(const DownloadSliceInfo& other); |
| 24 ~DownloadSliceInfo(); |
| 25 |
| 26 bool operator==(const DownloadSliceInfo&) const; |
| 27 |
| 28 // The id of the download in the database. |
| 29 DownloadId download_id; |
| 30 |
| 31 // Start position of the download request. |
| 32 int64_t offset; |
| 33 |
| 34 // The number of bytes received (so far). |
| 35 int64_t received_bytes; |
| 36 }; |
| 37 |
| 38 } // namespace history |
| 39 |
| 40 #endif // COMPONENTS_HISTORY_CORE_BROWSER_DOWNLOAD_SLICE_INFO_H_ |
OLD | NEW |