Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(536)

Issue 14947007: [Downloads] Allow acquiring dangerous download file. (Closed)

Created:
7 years, 7 months ago by asanka
Modified:
7 years, 6 months ago
CC:
chromium-reviews, benjhayden+dwatch_chromium.org, asanka, darin-cc_chromium.org, jam, joi+watch-content_chromium.org
Visibility:
Public.

Description

[Downloads] Allow acquiring dangerous download file. A dangerous download can be accepted by the user or rejected. If rejected, the downloaded file used to be deleted. This change adds DownloadItem::AcquireFileAndDeleteDownload() which allows the caller to acquire the dangerous file. The intended consumer of this feature is SafeBrowsing where the caller may want to acquire a dangerous file that's being discarded for the purpose of further analysis. Also change the logic during shutdown to no longer delete dangerous downloads, but to cancel them. TBR=rdsmith BUG=244604 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=202925

Patch Set 1 #

Total comments: 2

Patch Set 2 : Replace Delete() with DangerousDownloadDiscard() #

Patch Set 3 : Rename methods for consistency #

Total comments: 1

Patch Set 4 : Update download_manager_impl_unittest #

Patch Set 5 : Add AcquireFileAndDeleteDownload API instead of modifying Delete #

Patch Set 6 : Merge with r201622 #

Total comments: 6

Patch Set 7 : Rename methods and get rid of Delete() #

Total comments: 2

Patch Set 8 : Merge with r202089 #

Patch Set 9 : Fix UMA and support stealing interrupted downloads #

Total comments: 12

Patch Set 10 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+261 lines, -151 lines) Patch
M chrome/browser/automation/testing_automation_provider.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/download/download_browsertest.cc View 1 2 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/download/download_shelf_context_menu.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api_unittest.cc View 1 2 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/streams_private/streams_private_apitest.cc View 1 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/download/download_item_controller.mm View 1 2 3 4 5 6 1 chunk +2 lines, -4 lines 0 comments Download
M chrome/browser/ui/gtk/download/download_item_gtk.cc View 1 2 3 4 5 6 1 chunk +2 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/download/download_item_view.cc View 1 2 3 4 5 6 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/downloads_dom_handler.cc View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/android/download_controller_android_impl.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/download/download_browsertest.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/download/download_item_impl.h View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M content/browser/download/download_item_impl.cc View 1 2 3 4 5 6 7 8 7 chunks +39 lines, -41 lines 0 comments Download
M content/browser/download/download_item_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 29 chunks +127 lines, -30 lines 0 comments Download
M content/browser/download/download_manager_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -26 lines 0 comments Download
M content/browser/download/download_manager_impl_unittest.cc View 1 2 3 4 5 6 7 8 3 chunks +4 lines, -6 lines 0 comments Download
M content/browser/download/download_stats.h View 1 2 3 4 5 6 3 chunks +16 lines, -0 lines 0 comments Download
M content/browser/download/download_stats.cc View 1 2 3 4 5 6 1 chunk +22 lines, -0 lines 0 comments Download
M content/public/browser/download_item.h View 1 2 3 4 5 6 7 8 6 chunks +16 lines, -13 lines 0 comments Download
M content/public/test/download_test_observer.cc View 1 2 3 4 5 6 7 8 3 chunks +3 lines, -4 lines 0 comments Download
M content/public/test/mock_download_item.h View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
asanka
7 years, 7 months ago (2013-05-14 20:31:33 UTC) #1
benjhayden
https://codereview.chromium.org/14947007/diff/1/content/public/browser/download_item.h File content/public/browser/download_item.h (right): https://codereview.chromium.org/14947007/diff/1/content/public/browser/download_item.h#newcode151 content/public/browser/download_item.h:151: virtual void AcquireFileAndDeleteDownload( Method names containing "And" generally signal ...
7 years, 7 months ago (2013-05-14 20:48:05 UTC) #2
asanka
https://codereview.chromium.org/14947007/diff/1/content/public/browser/download_item.h File content/public/browser/download_item.h (right): https://codereview.chromium.org/14947007/diff/1/content/public/browser/download_item.h#newcode151 content/public/browser/download_item.h:151: virtual void AcquireFileAndDeleteDownload( On 2013/05/14 20:48:05, benjhayden_chromium wrote: > ...
7 years, 7 months ago (2013-05-14 21:14:34 UTC) #3
Randy Smith (Not in Mondays)
On 2013/05/14 21:14:34, asanka wrote: > https://codereview.chromium.org/14947007/diff/1/content/public/browser/download_item.h > File content/public/browser/download_item.h (right): > > https://codereview.chromium.org/14947007/diff/1/content/public/browser/download_item.h#newcode151 > ...
7 years, 7 months ago (2013-05-15 19:09:41 UTC) #4
asanka
PTAL?
7 years, 7 months ago (2013-05-22 19:33:10 UTC) #5
benjhayden
one fix then LGTM https://codereview.chromium.org/14947007/diff/20006/content/browser/download/download_manager_impl_unittest.cc File content/browser/download/download_manager_impl_unittest.cc (right): https://codereview.chromium.org/14947007/diff/20006/content/browser/download/download_manager_impl_unittest.cc#newcode110 content/browser/download/download_manager_impl_unittest.cc:110: MOCK_METHOD1(Delete, void(DeleteReason)); Update.
7 years, 7 months ago (2013-05-22 19:43:26 UTC) #6
Randy Smith (Not in Mondays)
On 2013/05/22 19:33:10, asanka wrote: > PTAL? {Asked Asanka offline for yet another go-round on ...
7 years, 7 months ago (2013-05-22 21:34:31 UTC) #7
asanka
PTAL? This goes back to the addition of the AcquireFileAndDeleteDownload() API.
7 years, 7 months ago (2013-05-22 22:37:59 UTC) #8
Randy Smith (Not in Mondays)
https://codereview.chromium.org/14947007/diff/32002/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): https://codereview.chromium.org/14947007/diff/32002/content/browser/download/download_item_impl.cc#newcode419 content/browser/download/download_item_impl.cc:419: callback.Run(current_path_); Under what circumstances will we take this path? ...
7 years, 7 months ago (2013-05-23 13:56:43 UTC) #9
asanka
https://codereview.chromium.org/14947007/diff/32002/content/public/browser/download_item.h File content/public/browser/download_item.h (right): https://codereview.chromium.org/14947007/diff/32002/content/public/browser/download_item.h#newcode147 content/public/browser/download_item.h:147: virtual void AcquireFileAndDeleteDownload( On 2013/05/23 13:56:43, rdsmith wrote: > ...
7 years, 7 months ago (2013-05-23 15:53:30 UTC) #10
Randy Smith (Not in Mondays)
On 2013/05/23 15:53:30, asanka wrote: > https://codereview.chromium.org/14947007/diff/32002/content/public/browser/download_item.h > File content/public/browser/download_item.h (right): > > https://codereview.chromium.org/14947007/diff/32002/content/public/browser/download_item.h#newcode147 > ...
7 years, 7 months ago (2013-05-23 15:54:12 UTC) #11
asanka
PTAL? https://codereview.chromium.org/14947007/diff/32002/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): https://codereview.chromium.org/14947007/diff/32002/content/browser/download/download_item_impl.cc#newcode419 content/browser/download/download_item_impl.cc:419: callback.Run(current_path_); On 2013/05/23 13:56:43, rdsmith wrote: > Under ...
7 years, 7 months ago (2013-05-24 01:17:11 UTC) #12
Randy Smith (Not in Mondays)
Only concern is around UMA semantics changing. https://codereview.chromium.org/14947007/diff/46001/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): https://codereview.chromium.org/14947007/diff/46001/content/browser/download/download_item_impl.cc#newcode373 content/browser/download/download_item_impl.cc:373: user_cancel ? ...
7 years, 7 months ago (2013-05-24 02:06:15 UTC) #13
asanka
There was a UMA glitch and I restored the ability to steal an interrupted dangerous ...
7 years, 7 months ago (2013-05-24 20:32:46 UTC) #14
Randy Smith (Not in Mondays)
Basically nits. I'll give you an LGTM now and let you decide how to deal ...
7 years, 6 months ago (2013-05-28 17:29:40 UTC) #15
asanka
https://codereview.chromium.org/14947007/diff/72023/content/browser/download/download_browsertest.cc File content/browser/download/download_browsertest.cc (right): https://codereview.chromium.org/14947007/diff/72023/content/browser/download/download_browsertest.cc#newcode704 content/browser/download/download_browsertest.cc:704: downloads[0]->Cancel(true); On 2013/05/28 17:29:40, rdsmith wrote: > Not a ...
7 years, 6 months ago (2013-05-28 22:01:38 UTC) #16
asanka
+joi: Could you look at content/public?
7 years, 6 months ago (2013-05-28 22:03:43 UTC) #17
Jói
LGTM for //content/public. +jam as FYI on API change.
7 years, 6 months ago (2013-05-28 22:52:15 UTC) #18
asanka
Thanks! TBRing renames and conversions of Delete() => Remove().
7 years, 6 months ago (2013-05-29 16:23:32 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/14947007/90001
7 years, 6 months ago (2013-05-29 16:25:01 UTC) #20
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 6 months ago (2013-05-29 17:08:18 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/14947007/90001
7 years, 6 months ago (2013-05-29 17:40:18 UTC) #22
commit-bot: I haz the power
7 years, 6 months ago (2013-05-29 18:57:47 UTC) #23
Message was sent while issue was closed.
Change committed as 202925

Powered by Google App Engine
This is Rietveld 408576698