Chromium Code Reviews| 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_JOB_INFO_H_ | |
| 6 #define COMPONENTS_HISTORY_CORE_BROWSER_DOWNLOAD_JOB_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 download job information that is stored in the download | |
| 16 // system's persistent store (or refers to it). Each download item can have | |
| 17 // 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.
| |
| 18 // start position. | |
| 19 struct DownloadJobInfo { | |
| 20 DownloadJobInfo(); | |
| 21 DownloadJobInfo(DownloadId download_id, | |
| 22 int job_id, | |
| 23 int64_t start_position, | |
| 24 int64_t length, | |
| 25 int64_t received_bytes, | |
| 26 DownloadState state, | |
| 27 DownloadInterruptReason interrupt_reason); | |
| 28 DownloadJobInfo(const DownloadJobInfo& other); | |
| 29 ~DownloadJobInfo(); | |
| 30 | |
| 31 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
| |
| 32 | |
| 33 // The id of the download in the database. Not changed by UpdateDownload(). | |
| 34 DownloadId download_id; | |
| 35 | |
| 36 // Job id of the download. | |
| 37 int job_id; | |
| 38 | |
| 39 // Start position of the download request. | |
| 40 int64_t start_position; | |
| 41 | |
| 42 // Data length to download. If length < 0, download should continue until | |
| 43 // the stream reaches the end. | |
| 44 int64_t length; | |
| 45 | |
| 46 // The number of bytes received (so far). | |
| 47 int64_t received_bytes; | |
| 48 | |
| 49 // The current state of the download. | |
| 50 DownloadState state; | |
| 51 | |
| 52 // The reason the download was interrupted, if state == kStateInterrupted. | |
| 53 DownloadInterruptReason interrupt_reason; | |
| 54 }; | |
| 55 | |
| 56 } // namespace history | |
| 57 | |
| 58 #endif // COMPONENTS_HISTORY_CORE_BROWSER_DOWNLOAD_JOB_INFO_H_ | |
| OLD | NEW |