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

Issue 11150027: Handle the case where IAttachmentExecute::Save() deletes a downloaded file. (Closed)

Created:
8 years, 2 months ago by asanka
Modified:
8 years, 1 month ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, jam, joi+watch-content_chromium.org, rginda+watch_chromium.org, eroman, darin-cc_chromium.org, rdsmith+dwatch_chromium.org, mmenke
Visibility:
Public.

Description

Handle the case where IAttachmentExecute::Save() deletes a downloaded file. As a first step, mark the download as interrupted due to the file being blocked or due to the file being infected by a virus. The interrupt reason will be shown to the user in the downloads shelf and the downloads page. BUG=155957 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=164632

Patch Set 1 #

Total comments: 6

Patch Set 2 : Merge with r164065 and address comments #

Patch Set 3 : Fix content_browsertests #

Patch Set 4 : Use different string for 'Virus Scan Failed' #

Patch Set 5 : Merge with r164402 to catch up with download_item_impl changes. #

Patch Set 6 : Fix Android #

Total comments: 4

Patch Set 7 : Rebase + Address comments + Update strings #

Unified diffs Side-by-side diffs Delta from patch set Stats (+221 lines, -90 lines) Patch
M chrome/app/generated_resources.grd View 1 chunk +17 lines, -1 line 0 comments Download
M chrome/browser/download/download_item_model.cc View 1 2 3 2 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/download/download_item_model_unittest.cc View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
M content/browser/download/base_file.h View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M content/browser/download/base_file.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/download/base_file_linux.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/download/base_file_mac.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/download/base_file_win.cc View 1 2 3 4 5 6 3 chunks +58 lines, -5 lines 0 comments Download
M content/browser/download/download_browsertest.cc View 1 2 3 4 5 6 4 chunks +7 lines, -5 lines 0 comments Download
M content/browser/download/download_file.h View 1 2 chunks +6 lines, -4 lines 0 comments Download
M content/browser/download/download_file_impl.h View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/download/download_file_impl.cc View 1 2 3 4 5 6 1 chunk +5 lines, -10 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 4 5 6 2 chunks +7 lines, -5 lines 0 comments Download
M content/browser/download/download_item_impl.cc View 1 2 3 4 5 6 5 chunks +12 lines, -6 lines 0 comments Download
M content/browser/download/download_item_impl_unittest.cc View 1 2 3 4 5 6 2 chunks +7 lines, -10 lines 0 comments Download
M content/browser/download/download_net_log_parameters.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/download/download_stats.h View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/download/mock_download_file.h View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/safe_util_win.h View 1 2 chunks +28 lines, -10 lines 0 comments Download
M content/browser/safe_util_win.cc View 1 2 4 chunks +25 lines, -24 lines 0 comments Download
M content/public/browser/download_interrupt_reason_values.h View 1 1 chunk +7 lines, -0 lines 0 comments Download
M net/base/net_log_event_type_list.h View 1 2 3 4 5 6 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 12 (0 generated)
asanka
8 years, 2 months ago (2012-10-15 21:51:09 UTC) #1
Randy Smith (Not in Mondays)
As long as we're in this code, can we put in some UMA so we ...
8 years, 2 months ago (2012-10-16 18:19:19 UTC) #2
Randy Smith (Not in Mondays)
You should probably also get a different reviewer for the windows specific stuff.
8 years, 2 months ago (2012-10-16 18:19:50 UTC) #3
asanka
sky: content/browser/safe_util_win.{h,cc} The changes are used by content/browser/download/base_file_win.cc The changes were necessary because IAttachmentExecute::Save() can, ...
8 years, 1 month ago (2012-10-25 23:51:27 UTC) #4
asanka
On 2012/10/16 18:19:19, rdsmith wrote: > As long as we're in this code, can we ...
8 years, 1 month ago (2012-10-26 19:32:13 UTC) #5
sky
I only looked at content/browser LGTM
8 years, 1 month ago (2012-10-26 20:38:49 UTC) #6
Randy Smith (Not in Mondays)
LGTM with TODO request below, safe_util_win.h comment up to you. https://codereview.chromium.org/11150027/diff/19008/content/browser/download/download_item_impl.h File content/browser/download/download_item_impl.h (right): https://codereview.chromium.org/11150027/diff/19008/content/browser/download/download_item_impl.h#newcode289 ...
8 years, 1 month ago (2012-10-27 23:54:28 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asanka@chromium.org/11150027/45001
8 years, 1 month ago (2012-10-29 06:34:49 UTC) #8
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
8 years, 1 month ago (2012-10-29 06:43:20 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asanka@chromium.org/11150027/45001
8 years, 1 month ago (2012-10-29 12:02:19 UTC) #10
commit-bot: I haz the power
Change committed as 164632
8 years, 1 month ago (2012-10-29 13:24:08 UTC) #11
asanka
8 years, 1 month ago (2012-10-29 15:33:59 UTC) #12
http://codereview.chromium.org/11150027/diff/19008/content/browser/download/d...
File content/browser/download/download_item_impl.h (right):

http://codereview.chromium.org/11150027/diff/19008/content/browser/download/d...
content/browser/download/download_item_impl.h:289: void
OnDownloadFileReleased(content::DownloadInterruptReason reason);
On 2012/10/27 23:54:28, rdsmith wrote:
> After having banged my head against the state machine wall as part of the
> download destination refactor, I'm feeling more uncomfortable about this type
of
> change (which changes the commit point, and allows state transitions to
> INTERRUPTED out of the COMPLETING state).  My current perspective is that the
> annotation should conceptually be part of the final rename, and release just
do
> a detach, and I'll be rewriting it that way as part of the DD refactor, but
> could you put a TODO here to eliminate the interrupt reason callback and move
> the annotation into the final rename?

Done.

http://codereview.chromium.org/11150027/diff/19008/content/browser/safe_util_...
File content/browser/safe_util_win.h (right):

http://codereview.chromium.org/11150027/diff/19008/content/browser/safe_util_...
content/browser/safe_util_win.h:52: // annotated.
On 2012/10/27 23:54:28, rdsmith wrote:
> Does this make sense?  If attachment execution services are not available on
all
> platforms, then wouldn't it make sense for this not to be an error on those
> platforms?
> 
> (I realize that this is a theoretical point, given that the error is ignored
at
> the calling site if the file is still around.)

BaseFile will still log the error, and it can be helpful for debugging in cases
where we are unable to instantiate the CLSID_AttachmentServices class.

I don't think it makes sense to add special handling for versions of Windows
where AES isn't available since it's been there since Windows XP SP2.

Powered by Google App Engine
This is Rietveld 408576698