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

Issue 2439533002: Download Feedback Service should upload all eligible downloads (Closed)

Created:
4 years, 2 months ago by Jialiu Lin
Modified:
4 years, 1 month ago
CC:
chromium-reviews, darin-cc_chromium.org, dbeam+watch-downloads_chromium.org, jam, Nathan Parker, tfarina
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

This CL fixes a 3-year-old regression which makes download feedback service only upload UNCOMMON downloads when user clicks "DISCARD". The correct behavior should be uploading all eligible downloads no matter user clicks KEEP or DISCARD on download shelf, where eligible means: 1) user is not incognito 2) user opted in for safe browsing extended reporting. 3) DownloadItemModel::ShouldAllowDownloadFeedback returns true This CL also changes the logic of StealDangerousDownload(), since if user chose to keep the download we cannot delete it after feedback is sent. In order to make download file immediately available to user without making them wait for upload complete, we make a temporary copy of the download file in DownloadItemImpl:: StealDangerousDownload(..) function, and upload this copy via DownloadFeedbackService::BeginFeedbackOrDeleteFile. This temp copy will be deleted after feedback is sent (~DownloadFeedbackImpl()). BUG=655799 Committed: https://crrev.com/2fe67a026c44af1daf09616c2b7bda2db5abee12 Cr-Commit-Position: refs/heads/master@{#432528}

Patch Set 1 #

Patch Set 2 : rebase-update #

Patch Set 3 : rebase update #

Patch Set 4 : nits #

Patch Set 5 : nit function renaming #

Total comments: 19

Patch Set 6 : Keeping download after feedback sent #

Patch Set 7 : fix content_unittests #

Patch Set 8 : validate download after download feedback uploaded #

Patch Set 9 : nit #

Patch Set 10 : haut download completion util uploader is done. #

Patch Set 11 : make a temp copy of download file for download feedback with KEEP #

Patch Set 12 : fix comments and nits #

Total comments: 20

Patch Set 13 : address comments from asanka@ and pkasting@ #

Patch Set 14 : make try bots happy #

Total comments: 10

Patch Set 15 : address/acknowledge comments from asanka@ #

Total comments: 2

Patch Set 16 : consolidate UMA invocation #

Patch Set 17 : make windows bots happy #

Unified diffs Side-by-side diffs Delta from patch set Stats (+303 lines, -98 lines) Patch
M chrome/browser/download/download_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +65 lines, -5 lines 0 comments Download
M chrome/browser/ntp_snippets/fake_download_item.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ntp_snippets/fake_download_item.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/safe_browsing/download_feedback_service.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +6 lines, -4 lines 0 comments Download
M chrome/browser/safe_browsing/download_feedback_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +16 lines, -11 lines 0 comments Download
M chrome/browser/safe_browsing/download_feedback_service_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 10 chunks +58 lines, -21 lines 0 comments Download
M chrome/browser/ui/views/download/download_item_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +15 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/download/download_item_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +35 lines, -24 lines 0 comments Download
M chrome/browser/ui/views/download/download_shelf_context_menu_view.h View 1 2 3 3 chunks +7 lines, -1 line 0 comments Download
M chrome/browser/ui/views/download/download_shelf_context_menu_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +17 lines, -3 lines 0 comments Download
M content/browser/download/download_item_impl.h View 1 2 3 4 5 10 11 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/download/download_item_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +32 lines, -9 lines 0 comments Download
M content/browser/download/download_item_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +31 lines, -7 lines 0 comments Download
M content/browser/download/download_manager_impl_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M content/public/browser/download_item.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +7 lines, -4 lines 0 comments Download
M content/public/test/mock_download_item.h View 1 2 3 4 5 10 11 1 chunk +1 line, -1 line 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 112 (76 generated)
Jialiu Lin
Hi asanka@ and pkasting@, Surprisingly, this is a 3 years old regression (without anyone complaining ...
4 years, 1 month ago (2016-10-24 18:14:31 UTC) #16
Peter Kasting
You added two reviewers. Please say what you want each to review? Or are you ...
4 years, 1 month ago (2016-10-24 20:31:59 UTC) #21
Jialiu Lin
Ah, sorry. asanka@, could you take a look at the overall flow (and content/browser/download/download_item_impl.cc for ...
4 years, 1 month ago (2016-10-24 20:39:30 UTC) #22
Peter Kasting
My only real concern is the question about whether a KEEP download will still be ...
4 years, 1 month ago (2016-10-24 21:39:08 UTC) #23
asanka
Unfortunately the StealDangerousDownload logic and the upload logic aren't written to deal with KEEP :-( ...
4 years, 1 month ago (2016-10-25 20:51:13 UTC) #26
Peter Kasting
Ah. Sounds like this can't land as-is then.
4 years, 1 month ago (2016-10-25 20:54:07 UTC) #27
Jialiu Lin
Thanks asanka@ and pkasting@. I'm now halfway changing the uploading logic (This CL is growing...). ...
4 years, 1 month ago (2016-10-25 21:07:10 UTC) #30
asanka
On 2016/10/25 at 21:07:10, jialiul wrote: > Thanks asanka@ and pkasting@. > I'm now halfway ...
4 years, 1 month ago (2016-10-26 13:56:13 UTC) #43
Jialiu Lin
Thanks, asanka@. My current implementation is to delay the download completion until upload is done ...
4 years, 1 month ago (2016-10-26 16:00:32 UTC) #44
Jialiu Lin
Hi asanka@, Could you take a look at this latest version? In this version, I ...
4 years, 1 month ago (2016-10-27 23:27:37 UTC) #49
asanka
On 2016/10/27 at 23:27:37, jialiul wrote: > Hi asanka@, > Could you take a look ...
4 years, 1 month ago (2016-10-31 14:38:55 UTC) #52
asanka
Overall LG. What's the largest file size that's supported by the feedback service? If the ...
4 years, 1 month ago (2016-11-01 20:58:58 UTC) #53
Peter Kasting
Do you still want me to review anything in this latest version?
4 years, 1 month ago (2016-11-01 21:01:09 UTC) #54
asanka
https://codereview.chromium.org/2439533002/diff/210001/chrome/browser/safe_browsing/download_feedback_service.cc File chrome/browser/safe_browsing/download_feedback_service.cc (right): https://codereview.chromium.org/2439533002/diff/210001/chrome/browser/safe_browsing/download_feedback_service.cc#newcode172 chrome/browser/safe_browsing/download_feedback_service.cc:172: if (path.empty()) We should probably measure this. Not a ...
4 years, 1 month ago (2016-11-01 21:09:23 UTC) #55
Jialiu Lin
On 2016/11/01 21:01:09, Peter Kasting wrote: > Do you still want me to review anything ...
4 years, 1 month ago (2016-11-01 21:10:13 UTC) #56
Jialiu Lin
On 2016/11/01 20:58:58, asanka wrote: > Overall LG. > > What's the largest file size ...
4 years, 1 month ago (2016-11-01 23:10:24 UTC) #57
Peter Kasting
LGTM, but I have concerns, which might be better addressed in another CL. https://codereview.chromium.org/2439533002/diff/210001/chrome/browser/ui/views/download/download_item_view.cc File ...
4 years, 1 month ago (2016-11-01 23:48:32 UTC) #58
Jialiu Lin
Thanks for your comments, asanka@ and pkasting@! Let me know if you have further comments. ...
4 years, 1 month ago (2016-11-03 20:16:50 UTC) #64
asanka
LGTM. You can treat the comments as nits or stuff for followups as appropriate. Thanks! ...
4 years, 1 month ago (2016-11-07 16:01:55 UTC) #72
Jialiu Lin
Thanks for your comments asanka@. And sorry for my late reply. I was OOO last ...
4 years, 1 month ago (2016-11-14 20:57:39 UTC) #76
Jialiu Lin
Add other reviewers: treib for chrome/browser/ntp_snippets/* holte@ for uma metric nick@ for content/public/* Please feel ...
4 years, 1 month ago (2016-11-14 21:00:08 UTC) #78
Jialiu Lin
nick@chromium.org: Please review changes in content/public/*
4 years, 1 month ago (2016-11-14 21:01:56 UTC) #81
ncarter (slow)
content/public lgtm
4 years, 1 month ago (2016-11-14 21:07:19 UTC) #82
Steven Holte
https://codereview.chromium.org/2439533002/diff/270001/chrome/browser/safe_browsing/download_feedback_service.cc File chrome/browser/safe_browsing/download_feedback_service.cc (right): https://codereview.chromium.org/2439533002/diff/270001/chrome/browser/safe_browsing/download_feedback_service.cc#newcode173 chrome/browser/safe_browsing/download_feedback_service.cc:173: UMA_HISTOGRAM_BOOLEAN("SBDownloadFeedback.EmptyFilePathFailure", true); It would be better to consolidate these ...
4 years, 1 month ago (2016-11-14 21:34:34 UTC) #83
Jialiu Lin
Thanks, holte@! UMA macro invocation consolidated. https://codereview.chromium.org/2439533002/diff/270001/chrome/browser/safe_browsing/download_feedback_service.cc File chrome/browser/safe_browsing/download_feedback_service.cc (right): https://codereview.chromium.org/2439533002/diff/270001/chrome/browser/safe_browsing/download_feedback_service.cc#newcode173 chrome/browser/safe_browsing/download_feedback_service.cc:173: UMA_HISTOGRAM_BOOLEAN("SBDownloadFeedback.EmptyFilePathFailure", true); On ...
4 years, 1 month ago (2016-11-14 21:55:07 UTC) #84
Steven Holte
On 2016/11/14 21:55:07, Jialiu Lin wrote: > Thanks, holte@! UMA macro invocation consolidated. > > ...
4 years, 1 month ago (2016-11-14 21:55:47 UTC) #85
Marc Treib
c/b/ntp_snippets/ lgtm
4 years, 1 month ago (2016-11-15 08:20:37 UTC) #86
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/2439533002/290001
4 years, 1 month ago (2016-11-15 17:03:59 UTC) #89
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/262513)
4 years, 1 month ago (2016-11-15 18:50:45 UTC) #91
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/2439533002/330001
4 years, 1 month ago (2016-11-16 00:27:40 UTC) #100
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/68299)
4 years, 1 month ago (2016-11-16 00:57:20 UTC) #102
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/2439533002/330001
4 years, 1 month ago (2016-11-16 02:37:08 UTC) #104
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/68424)
4 years, 1 month ago (2016-11-16 04:51:22 UTC) #106
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/2439533002/330001
4 years, 1 month ago (2016-11-16 17:03:45 UTC) #108
commit-bot: I haz the power
Committed patchset #17 (id:330001)
4 years, 1 month ago (2016-11-16 17:11:04 UTC) #110
commit-bot: I haz the power
4 years, 1 month ago (2016-11-16 17:18:21 UTC) #112
Message was sent while issue was closed.
Patchset 17 (id:??) landed as
https://crrev.com/2fe67a026c44af1daf09616c2b7bda2db5abee12
Cr-Commit-Position: refs/heads/master@{#432528}

Powered by Google App Engine
This is Rietveld 408576698