Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Side by Side Diff: components/history/core/browser/download_job_info.h

Issue 2665243003: add a download slices table into history download db (Closed)
Patch Set: addressing comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698