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

Issue 2665243003: add a download slices table into history download db (Closed)

Created:
3 years, 10 months ago by qinmin
Modified:
3 years, 10 months ago
CC:
chromium-reviews, grt+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

add a download slices table into history download db To support parallel downloads, a download item may have multiple jobs. For each job, it will write to the target file with a different offset. we need to store the information for each piece of slice so download resumption can work. This CL adds a new table to store the slice information. This change also increases the history db version by 1 BUG=644352 Review-Url: https://codereview.chromium.org/2665243003 Cr-Commit-Position: refs/heads/master@{#450606} Committed: https://chromium.googlesource.com/chromium/src/+/b2925e8fc7cacf09215b6c9c12b975fb7a9bdee5

Patch Set 1 #

Total comments: 2

Patch Set 2 : increase history db version #

Total comments: 18

Patch Set 3 : addressing comments #

Total comments: 26

Patch Set 4 : addressing comments #

Total comments: 4

Patch Set 5 : use Select changes() instead of select count(*) #

Total comments: 22

Patch Set 6 : addressing comments #

Total comments: 29

Patch Set 7 : addressing comments #

Patch Set 8 : Simplify DownloadJobInfo #

Total comments: 1

Patch Set 9 : rename download_job_info to download_slice_info #

Total comments: 14

Patch Set 10 : nits #

Total comments: 2

Patch Set 11 : nit #

Patch Set 12 : add test file to BUILD.gn #

Unified diffs Side-by-side diffs Delta from patch set Stats (+508 lines, -62 lines) Patch
M chrome/browser/download/download_history.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M components/history/core/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +4 lines, -0 lines 0 comments Download
M components/history/core/browser/download_database.h View 1 2 3 4 5 6 7 8 4 chunks +16 lines, -2 lines 0 comments Download
M components/history/core/browser/download_database.cc View 1 2 3 4 5 6 7 8 9 11 chunks +116 lines, -16 lines 0 comments Download
M components/history/core/browser/download_row.h View 1 2 3 4 5 6 7 8 3 chunks +5 lines, -1 line 0 comments Download
M components/history/core/browser/download_row.cc View 1 2 3 4 5 6 7 8 3 chunks +31 lines, -27 lines 0 comments Download
A components/history/core/browser/download_slice_info.h View 1 2 3 4 5 6 7 8 1 chunk +40 lines, -0 lines 0 comments Download
A components/history/core/browser/download_slice_info.cc View 1 2 3 4 5 6 7 8 1 chunk +32 lines, -0 lines 0 comments Download
A components/history/core/browser/download_slice_info_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +22 lines, -0 lines 0 comments Download
M components/history/core/browser/download_types.h View 1 2 3 4 5 6 2 chunks +3 lines, -1 line 0 comments Download
M components/history/core/browser/download_types.cc View 1 2 3 4 5 6 1 chunk +5 lines, -4 lines 0 comments Download
M components/history/core/browser/history_backend_db_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 11 chunks +183 lines, -7 lines 0 comments Download
M components/history/core/browser/history_database.cc View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -1 line 0 comments Download
M components/history/core/test/history_backend_db_base_test.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
A components/test/data/history/history.32.sql View 1 2 3 4 5 6 7 8 9 1 chunk +27 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 83 (32 generated)
qinmin
PTAL
3 years, 10 months ago (2017-02-01 18:38:01 UTC) #2
asanka
Is it possible to come up with a scheme where the shard state can be ...
3 years, 10 months ago (2017-02-01 22:34:10 UTC) #6
qinmin
Our current plan is to use a single file, not stitching shards together for parallel ...
3 years, 10 months ago (2017-02-01 23:07:10 UTC) #9
qinmin
https://codereview.chromium.org/2665243003/diff/20001/components/history/core/browser/download_database.cc File components/history/core/browser/download_database.cc (right): https://codereview.chromium.org/2665243003/diff/20001/components/history/core/browser/download_database.cc#newcode487 components/history/core/browser/download_database.cc:487: if (IsParallelDownloadingEnabled()) { On 2017/02/01 22:34:10, asanka wrote: > ...
3 years, 10 months ago (2017-02-01 23:37:26 UTC) #10
asanka
https://codereview.chromium.org/2665243003/diff/40001/components/history/core/browser/download_constants.h File components/history/core/browser/download_constants.h (right): https://codereview.chromium.org/2665243003/diff/40001/components/history/core/browser/download_constants.h#newcode8 components/history/core/browser/download_constants.h:8: #include "base/feature_list.h" Not needed. https://codereview.chromium.org/2665243003/diff/40001/components/history/core/browser/download_database.cc File components/history/core/browser/download_database.cc (right): https://codereview.chromium.org/2665243003/diff/40001/components/history/core/browser/download_database.cc#newcode323 ...
3 years, 10 months ago (2017-02-02 19:06:28 UTC) #13
asanka
On 2017/02/01 at 23:07:10, qinmin wrote: > Our current plan is to use a single ...
3 years, 10 months ago (2017-02-02 19:29:08 UTC) #14
asanka
+sky: for /components/history/
3 years, 10 months ago (2017-02-02 19:43:36 UTC) #15
qinmin
https://codereview.chromium.org/2665243003/diff/40001/components/history/core/browser/download_constants.h File components/history/core/browser/download_constants.h (right): https://codereview.chromium.org/2665243003/diff/40001/components/history/core/browser/download_constants.h#newcode8 components/history/core/browser/download_constants.h:8: #include "base/feature_list.h" On 2017/02/02 19:06:27, asanka wrote: > Not ...
3 years, 10 months ago (2017-02-02 22:31:32 UTC) #16
qinmin
On 2017/02/02 19:29:08, asanka wrote: > On 2017/02/01 at 23:07:10, qinmin wrote: > > Our ...
3 years, 10 months ago (2017-02-02 23:53:38 UTC) #17
sky
https://codereview.chromium.org/2665243003/diff/60001/components/history/core/browser/download_database.cc File components/history/core/browser/download_database.cc (right): https://codereview.chromium.org/2665243003/diff/60001/components/history/core/browser/download_database.cc#newcode324 components/history/core/browser/download_database.cc:324: "state INTEGER NOT NULL," // To be determined. Is ...
3 years, 10 months ago (2017-02-03 16:02:34 UTC) #18
qinmin
https://codereview.chromium.org/2665243003/diff/60001/components/history/core/browser/download_database.cc File components/history/core/browser/download_database.cc (right): https://codereview.chromium.org/2665243003/diff/60001/components/history/core/browser/download_database.cc#newcode324 components/history/core/browser/download_database.cc:324: "state INTEGER NOT NULL," // To be determined. On ...
3 years, 10 months ago (2017-02-04 00:06:57 UTC) #19
sky
+shess for following question https://codereview.chromium.org/2665243003/diff/80001/components/history/core/browser/download_database.cc File components/history/core/browser/download_database.cc (right): https://codereview.chromium.org/2665243003/diff/80001/components/history/core/browser/download_database.cc#newcode760 components/history/core/browser/download_database.cc:760: sql::Statement statement_query(GetDB().GetCachedStatement( On 2017/02/04 00:06:57, ...
3 years, 10 months ago (2017-02-06 16:29:04 UTC) #21
qinmin
https://codereview.chromium.org/2665243003/diff/80001/components/history/core/browser/download_database.cc File components/history/core/browser/download_database.cc (right): https://codereview.chromium.org/2665243003/diff/80001/components/history/core/browser/download_database.cc#newcode760 components/history/core/browser/download_database.cc:760: sql::Statement statement_query(GetDB().GetCachedStatement( On 2017/02/06 16:29:04, sky wrote: > On ...
3 years, 10 months ago (2017-02-06 16:41:53 UTC) #22
qinmin
https://codereview.chromium.org/2665243003/diff/80001/components/history/core/browser/download_database.cc File components/history/core/browser/download_database.cc (right): https://codereview.chromium.org/2665243003/diff/80001/components/history/core/browser/download_database.cc#newcode760 components/history/core/browser/download_database.cc:760: sql::Statement statement_query(GetDB().GetCachedStatement( On 2017/02/06 16:41:53, qinmin wrote: > On ...
3 years, 10 months ago (2017-02-06 19:25:02 UTC) #23
Scott Hess - ex-Googler
https://codereview.chromium.org/2665243003/diff/100001/components/history/core/browser/download_database.cc File components/history/core/browser/download_database.cc (right): https://codereview.chromium.org/2665243003/diff/100001/components/history/core/browser/download_database.cc#newcode341 components/history/core/browser/download_database.cc:341: GetDB().Execute(kJobsSchema)); IMHO this is getting convoluted. Someone coming along ...
3 years, 10 months ago (2017-02-06 21:22:16 UTC) #28
Scott Hess - ex-Googler
https://codereview.chromium.org/2665243003/diff/100001/components/history/core/browser/download_database.cc File components/history/core/browser/download_database.cc (right): https://codereview.chromium.org/2665243003/diff/100001/components/history/core/browser/download_database.cc#newcode560 components/history/core/browser/download_database.cc:560: !CreateDownloadJob(data.download_job_info[i])) { Oh, as I noted elsewhere, since update ...
3 years, 10 months ago (2017-02-06 21:23:51 UTC) #29
Scott Hess - ex-Googler
On 2017/02/06 19:25:02, qinmin wrote: > https://codereview.chromium.org/2665243003/diff/80001/components/history/core/browser/download_database.cc > File components/history/core/browser/download_database.cc (right): > > https://codereview.chromium.org/2665243003/diff/80001/components/history/core/browser/download_database.cc#newcode760 > ...
3 years, 10 months ago (2017-02-06 21:40:48 UTC) #30
qinmin
On 2017/02/06 21:40:48, Scott Hess wrote: > On 2017/02/06 19:25:02, qinmin wrote: > > > ...
3 years, 10 months ago (2017-02-06 23:39:12 UTC) #31
qinmin
https://codereview.chromium.org/2665243003/diff/100001/components/history/core/browser/download_database.cc File components/history/core/browser/download_database.cc (right): https://codereview.chromium.org/2665243003/diff/100001/components/history/core/browser/download_database.cc#newcode341 components/history/core/browser/download_database.cc:341: GetDB().Execute(kJobsSchema)); On 2017/02/06 21:22:16, Scott Hess wrote: > IMHO ...
3 years, 10 months ago (2017-02-06 23:39:22 UTC) #32
qinmin
reviewers, PTAL again. @asanka, I added some comments in DownloadDatabase::InitDownloadTable(), please check if they are ...
3 years, 10 months ago (2017-02-07 00:24:26 UTC) #35
asanka
LGTM % comments https://codereview.chromium.org/2665243003/diff/120001/components/history/core/browser/download_database.cc File components/history/core/browser/download_database.cc (right): https://codereview.chromium.org/2665243003/diff/120001/components/history/core/browser/download_database.cc#newcode331 components/history/core/browser/download_database.cc:331: // If the "downloads" table exist, ...
3 years, 10 months ago (2017-02-08 03:50:50 UTC) #39
David Trainor- moved to gerrit
lgtm % nits https://codereview.chromium.org/2665243003/diff/120001/components/history/core/browser/download_database.cc File components/history/core/browser/download_database.cc (right): https://codereview.chromium.org/2665243003/diff/120001/components/history/core/browser/download_database.cc#newcode565 components/history/core/browser/download_database.cc:565: if (!CreateOrUpdateDownloadJob(data.download_job_info[i])) Do we have to ...
3 years, 10 months ago (2017-02-08 07:54:05 UTC) #40
David Trainor- moved to gerrit
lgtm % nits
3 years, 10 months ago (2017-02-08 07:54:06 UTC) #41
Scott Hess - ex-Googler
https://codereview.chromium.org/2665243003/diff/120001/components/history/core/browser/download_database.cc File components/history/core/browser/download_database.cc (right): https://codereview.chromium.org/2665243003/diff/120001/components/history/core/browser/download_database.cc#newcode333 components/history/core/browser/download_database.cc:333: // create it later. Sigh. This is why we ...
3 years, 10 months ago (2017-02-08 22:01:40 UTC) #42
qinmin
https://codereview.chromium.org/2665243003/diff/120001/components/history/core/browser/download_database.cc File components/history/core/browser/download_database.cc (right): https://codereview.chromium.org/2665243003/diff/120001/components/history/core/browser/download_database.cc#newcode331 components/history/core/browser/download_database.cc:331: // If the "downloads" table exist, "download_url_chain" might not ...
3 years, 10 months ago (2017-02-09 01:01:42 UTC) #43
qinmin
3 years, 10 months ago (2017-02-09 01:01:43 UTC) #44
qinmin
+holte for tools/metrics OWNER
3 years, 10 months ago (2017-02-09 01:06:51 UTC) #46
Steven Holte
histograms lgtm
3 years, 10 months ago (2017-02-09 01:52:05 UTC) #47
asanka
https://codereview.chromium.org/2665243003/diff/120001/components/history/core/browser/download_job_info.h File components/history/core/browser/download_job_info.h (right): https://codereview.chromium.org/2665243003/diff/120001/components/history/core/browser/download_job_info.h#newcode37 components/history/core/browser/download_job_info.h:37: int job_id; On 2017/02/09 at 01:01:42, qinmin wrote: > ...
3 years, 10 months ago (2017-02-09 02:19:47 UTC) #48
qinmin
On 2017/02/09 02:19:47, asanka wrote: > https://codereview.chromium.org/2665243003/diff/120001/components/history/core/browser/download_job_info.h > File components/history/core/browser/download_job_info.h (right): > > https://codereview.chromium.org/2665243003/diff/120001/components/history/core/browser/download_job_info.h#newcode37 > ...
3 years, 10 months ago (2017-02-09 06:58:11 UTC) #49
asanka
On 2017/02/09 at 06:58:11, qinmin wrote: > On 2017/02/09 02:19:47, asanka wrote: > > https://codereview.chromium.org/2665243003/diff/120001/components/history/core/browser/download_job_info.h ...
3 years, 10 months ago (2017-02-09 21:17:21 UTC) #50
qinmin
On 2017/02/09 21:17:21, asanka wrote: > On 2017/02/09 at 06:58:11, qinmin wrote: > > On ...
3 years, 10 months ago (2017-02-09 23:31:17 UTC) #51
asanka
nit: job => slice https://codereview.chromium.org/2665243003/diff/160001/components/history/core/browser/download_database.cc File components/history/core/browser/download_database.cc (right): https://codereview.chromium.org/2665243003/diff/160001/components/history/core/browser/download_database.cc#newcode559 components/history/core/browser/download_database.cc:559: for (size_t i = 0; ...
3 years, 10 months ago (2017-02-10 16:30:30 UTC) #52
asanka
Oh and thank you for dealing with all these comments!
3 years, 10 months ago (2017-02-10 16:32:31 UTC) #53
qinmin
On 2017/02/10 16:30:30, asanka wrote: > nit: job => slice > > https://codereview.chromium.org/2665243003/diff/160001/components/history/core/browser/download_database.cc > File ...
3 years, 10 months ago (2017-02-10 18:29:42 UTC) #55
qinmin
PTAL again. Updated the DownloadJobInfo to DownloadSliceInfo, and changed the CL description. The job status ...
3 years, 10 months ago (2017-02-10 18:39:09 UTC) #57
Scott Hess - ex-Googler
I think my suggestions are all in the "Obvious suggestion, you got this" or "Suggestion, ...
3 years, 10 months ago (2017-02-10 22:41:12 UTC) #58
qinmin
Thanks Scott for your thoughts. Based on our experiment with parallel downloading, the results are ...
3 years, 10 months ago (2017-02-11 00:21:45 UTC) #59
qinmin
https://codereview.chromium.org/2665243003/diff/180001/components/history/core/browser/download_database.cc File components/history/core/browser/download_database.cc (right): https://codereview.chromium.org/2665243003/diff/180001/components/history/core/browser/download_database.cc#newcode26 components/history/core/browser/download_database.cc:26: #include "download_slice_info.h" On 2017/02/10 22:41:11, Scott Hess wrote: > ...
3 years, 10 months ago (2017-02-11 00:23:54 UTC) #60
Scott Hess - ex-Googler
Changes LGTM, with a very minor nit that you can either ignore or just change ...
3 years, 10 months ago (2017-02-11 03:31:12 UTC) #61
Scott Hess - ex-Googler
On 2017/02/11 00:21:45, qinmin wrote: > Thanks Scott for your thoughts. Based on our experiment ...
3 years, 10 months ago (2017-02-11 03:32:53 UTC) #62
sky
LGTM
3 years, 10 months ago (2017-02-13 17:35:44 UTC) #63
qinmin
https://codereview.chromium.org/2665243003/diff/200001/components/history/core/browser/history_backend_db_unittest.cc File components/history/core/browser/history_backend_db_unittest.cc (right): https://codereview.chromium.org/2665243003/diff/200001/components/history/core/browser/history_backend_db_unittest.cc#newcode763 components/history/core/browser/history_backend_db_unittest.cc:763: ASSERT_TRUE(db.Execute(insert_statement.c_str())); On 2017/02/11 03:31:12, Scott Hess wrote: > Just ...
3 years, 10 months ago (2017-02-13 22:02:11 UTC) #68
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2665243003/220001
3 years, 10 months ago (2017-02-14 17:08:26 UTC) #71
commit-bot: I haz the power
Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/builds/154871)
3 years, 10 months ago (2017-02-14 18:13:51 UTC) #73
Scott Hess - ex-Googler
On 2017/02/14 18:13:51, commit-bot: I haz the power wrote: > Try jobs failed on following ...
3 years, 10 months ago (2017-02-14 18:16:43 UTC) #74
asanka
On 2017/02/14 at 18:16:43, shess wrote: > On 2017/02/14 18:13:51, commit-bot: I haz the power ...
3 years, 10 months ago (2017-02-14 21:31:28 UTC) #75
qinmin
On 2017/02/14 21:31:28, asanka wrote: > On 2017/02/14 at 18:16:43, shess wrote: > > On ...
3 years, 10 months ago (2017-02-14 23:22:22 UTC) #76
Scott Hess - ex-Googler
lgtm
3 years, 10 months ago (2017-02-14 23:30:18 UTC) #77
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2665243003/240001
3 years, 10 months ago (2017-02-15 00:08:12 UTC) #80
commit-bot: I haz the power
3 years, 10 months ago (2017-02-15 06:48:28 UTC) #83
Message was sent while issue was closed.
Committed patchset #12 (id:240001) as
https://chromium.googlesource.com/chromium/src/+/b2925e8fc7cacf09215b6c9c12b9...

Powered by Google App Engine
This is Rietveld 408576698