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

Issue 2832223004: interrupt and resume download with CONTENT_LENGTH_MISMATCH errors (Closed)

Created:
3 years, 8 months ago by qinmin
Modified:
3 years, 7 months ago
CC:
chromium-reviews, jam, David Trainor- moved to gerrit, srahim+watch_chromium.org, darin-cc_chromium.org, asvitkine+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

interrupt and resume download with CONTENT_LENGTH_MISMATCH errors If a download ends with CONTENT_LENGTH_MISMATCH error, chrome treat it as completed. However, this could happen if server closes the connection too early. And it causes the downloaded file size to be incorrect. And with pause/resume functionalities, this could happen more frequently. This change treats these download as interrupted if strong validators are present. For downloads without strong validators, auto resumption could cause them to enter a restart->interrupt->restart cycle. As a result, download is treated as completed if there are no strong validators. BUG=453357 Review-Url: https://codereview.chromium.org/2832223004 Cr-Commit-Position: refs/heads/master@{#467897} Committed: https://chromium.googlesource.com/chromium/src/+/b42016cc0c9f244e44a437ca060f50ff0edab189

Patch Set 1 #

Total comments: 12

Patch Set 2 : addressing comments #

Patch Set 3 : add extension api change #

Total comments: 10

Patch Set 4 : fixing nits #

Patch Set 5 : fix tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+126 lines, -12 lines) Patch
M chrome/app/generated_resources.grd View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/download/download_item_model.cc View 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/download/download_item_model_unittest.cc View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/downloads.idl View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/history/content/browser/content_history_backend_db_unittest.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/download/download_interrupt_reasons_impl.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/download/download_item_impl.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/download/download_item_impl.cc View 1 2 3 3 chunks +15 lines, -0 lines 0 comments Download
M content/browser/download/download_item_impl_unittest.cc View 1 2 3 2 chunks +39 lines, -1 line 0 comments Download
M content/browser/download/download_request_core.h View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/download/download_request_core.cc View 1 2 3 4 4 chunks +24 lines, -10 lines 0 comments Download
M content/browser/download/download_stats.h View 1 1 chunk +11 lines, -0 lines 0 comments Download
M content/public/browser/download_interrupt_reason_values.h View 1 1 chunk +6 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 30 (14 generated)
qinmin
PTAL asanka@, please take a look at this. For all download without strong validators, i ...
3 years, 8 months ago (2017-04-21 22:15:10 UTC) #2
Ilya Sherman
histograms.xml lgtm
3 years, 8 months ago (2017-04-21 22:45:11 UTC) #3
David Trainor- moved to gerrit
https://codereview.chromium.org/2832223004/diff/1/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): https://codereview.chromium.org/2832223004/diff/1/content/browser/download/download_item_impl.cc#newcode1804 content/browser/download/download_item_impl.cc:1804: if (reason == DOWNLOAD_INTERRUPT_REASON_SERVER_CONTENT_LENGTH_MISMATCH) Remove extra space after == ...
3 years, 8 months ago (2017-04-25 03:50:41 UTC) #4
qinmin
https://codereview.chromium.org/2832223004/diff/1/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): https://codereview.chromium.org/2832223004/diff/1/content/browser/download/download_item_impl.cc#newcode1804 content/browser/download/download_item_impl.cc:1804: if (reason == DOWNLOAD_INTERRUPT_REASON_SERVER_CONTENT_LENGTH_MISMATCH) On 2017/04/25 03:50:41, David Trainor-ping ...
3 years, 8 months ago (2017-04-25 19:27:47 UTC) #5
xingliu
I found this comment in the code: https://cs.chromium.org/chromium/src/net/url_request/url_request_http_job.cc?type=cs&q=CONTENT_LENGTH_MISMATCH+package:%5Echromium$&l=1316 Also it links to a bug: https://bugs.chromium.org/p/chromium/issues/detail?id=79694 ...
3 years, 8 months ago (2017-04-25 19:32:05 UTC) #6
qinmin
On 2017/04/25 19:32:05, xingliu wrote: > I found this comment in the code: > https://cs.chromium.org/chromium/src/net/url_request/url_request_http_job.cc?type=cs&q=CONTENT_LENGTH_MISMATCH+package:%5Echromium$&l=1316 ...
3 years, 8 months ago (2017-04-25 20:51:28 UTC) #7
qinmin
https://codereview.chromium.org/2832223004/diff/1/content/public/browser/download_interrupt_reason_values.h File content/public/browser/download_interrupt_reason_values.h (right): https://codereview.chromium.org/2832223004/diff/1/content/public/browser/download_interrupt_reason_values.h#newcode122 content/public/browser/download_interrupt_reason_values.h:122: INTERRUPT_REASON(SERVER_CONTENT_LENGTH_MISMATCH, 38) On 2017/04/25 19:32:05, xingliu wrote: > FYI: ...
3 years, 8 months ago (2017-04-25 20:52:12 UTC) #8
David Trainor- moved to gerrit
lgtm % xingliu@ https://codereview.chromium.org/2832223004/diff/40001/content/browser/download/download_item_impl_unittest.cc File content/browser/download/download_item_impl_unittest.cc (right): https://codereview.chromium.org/2832223004/diff/40001/content/browser/download/download_item_impl_unittest.cc#newcode722 content/browser/download/download_item_impl_unittest.cc:722: // Test that a download is ...
3 years, 8 months ago (2017-04-26 16:09:01 UTC) #9
xingliu
lgtm
3 years, 8 months ago (2017-04-26 16:46:46 UTC) #10
qinmin
+sky@ for OWNER of components/history/content/browser/ and chrome/common/ +jam@ for OWNER of content/public/browser/download_interrupt_reason_values.h
3 years, 8 months ago (2017-04-26 17:19:58 UTC) #12
sky
LGTM
3 years, 8 months ago (2017-04-26 19:55:43 UTC) #13
asanka
LGTM % nits https://codereview.chromium.org/2832223004/diff/40001/chrome/app/generated_resources.grd File chrome/app/generated_resources.grd (right): https://codereview.chromium.org/2832223004/diff/40001/chrome/app/generated_resources.grd#newcode1387 chrome/app/generated_resources.grd:1387: Content length mismatch Nit: This phrase ...
3 years, 8 months ago (2017-04-26 21:17:33 UTC) #14
jam
lgtm
3 years, 7 months ago (2017-04-27 15:35:59 UTC) #15
qinmin
https://codereview.chromium.org/2832223004/diff/40001/chrome/app/generated_resources.grd File chrome/app/generated_resources.grd (right): https://codereview.chromium.org/2832223004/diff/40001/chrome/app/generated_resources.grd#newcode1387 chrome/app/generated_resources.grd:1387: Content length mismatch On 2017/04/26 21:17:33, asanka wrote: > ...
3 years, 7 months ago (2017-04-27 18:20:54 UTC) #16
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/2832223004/100001
3 years, 7 months ago (2017-04-28 04:15:23 UTC) #27
commit-bot: I haz the power
3 years, 7 months ago (2017-04-28 05:23:45 UTC) #30
Message was sent while issue was closed.
Committed patchset #5 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/b42016cc0c9f244e44a437ca060f...

Powered by Google App Engine
This is Rietveld 408576698