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

Issue 26938003: Don't prompt to save malicious downloads on exit (Closed)

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

Description

On browser close, the browser checks to see if there are any pending downloads. Currently: If there are any pending downloads, it halts the download and asks the user to keep or save the download. New behavior: The user won't be prompted for pending downloads that are malicious (DANGEROUS_HOST, DANGEROUS_URL, DANGEROUS_CONTENT). Instead, they'll just be automatically cleaned up on exit. Note that if a user is prompted for *other* downloads, they may still be taken to the chrome://downloads page and see the malicious download while they're there. Added a new test in chrome/browser/lifetime/browser_close_manager_browsertest.cc. BUG=306230, 305387 TEST= 1. Download a malicious file (e.g., http://download.safebrowsingtest.com/download/test) 2. Quit the browser 3. The browser should close without a warning 4. Download a dangerous file like a SWF 5. Quit the browser 6. The browser should pop up a dialog asking you whether you should save the file R=asanka@chromium.org, benjhayden@chromium.org, joi@chromium.org, pkasting@chromium.org, thakis@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=229784

Patch Set 1 #

Patch Set 2 : Small tweak #

Patch Set 3 : Modified existing browsertests #

Patch Set 4 : Added a new browser test #

Patch Set 5 : Updated comments #

Patch Set 6 : Fixed unit test compile error #

Total comments: 12

Patch Set 7 : Changes for asanka #

Patch Set 8 : Exclude DANGEROUS_FILE and update browsertest accordingly #

Patch Set 9 : Updated comments #

Total comments: 8

Patch Set 10 : Changed to only target Malicious (not Maybe-Malicious or Dangerous) files #

Total comments: 1

Patch Set 11 : Changed test to not need SetDangerType #

Patch Set 12 : Fixing a bug in app_controller_mac.mm #

Patch Set 13 : Debugging cros failure #

Patch Set 14 : Removed logging statements, disabled browser test on CrOS #

Patch Set 15 : Testing for CrOS #

Total comments: 6

Patch Set 16 : after slaughtering three sacrificial lambs, perhaps this will work #

Patch Set 17 : Removed unneeded code #

Unified diffs Side-by-side diffs Delta from patch set Stats (+146 lines, -31 lines) Patch
M chrome/browser/app_controller_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/download/download_browsertest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/download/download_item_model.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/download/download_service.h View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -4 lines 0 comments Download
M chrome/browser/download/download_service.cc View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -5 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/lifetime/application_lifetime.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/lifetime/browser_close_manager.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/lifetime/browser_close_manager_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 6 chunks +82 lines, -0 lines 0 comments Download
M chrome/browser/ui/browser.cc View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/ui/browser_close_browsertest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +8 lines, -13 lines 0 comments Download
M content/browser/download/download_manager_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/download/download_manager_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +14 lines, -0 lines 0 comments Download
M content/public/browser/download_manager.h View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M content/public/test/download_test_observer.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M content/public/test/download_test_observer.cc View 1 2 3 13 15 1 chunk +4 lines, -0 lines 0 comments Download
M content/public/test/mock_download_manager.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
felt
Hi Asanka, Can you please review this CL? Adrienne
7 years, 2 months ago (2013-10-11 02:44:42 UTC) #1
asanka
I'm guessing it's intentional that file type based dangerous downloads will also be discarded? As ...
7 years, 2 months ago (2013-10-11 16:02:35 UTC) #2
felt
As far as the DANGEROUS_FILE ones go... I am waffling on that. I can see ...
7 years, 2 months ago (2013-10-11 17:26:43 UTC) #3
felt
https://codereview.chromium.org/26938003/diff/16001/chrome/browser/lifetime/browser_close_manager_browsertest.cc File chrome/browser/lifetime/browser_close_manager_browsertest.cc (right): https://codereview.chromium.org/26938003/diff/16001/chrome/browser/lifetime/browser_close_manager_browsertest.cc#newcode634 chrome/browser/lifetime/browser_close_manager_browsertest.cc:634: content::DownloadTestObserverInterrupted observer( On 2013/10/11 16:02:35, asanka wrote: > You ...
7 years, 2 months ago (2013-10-11 17:39:37 UTC) #4
asanka
Regarding DANGEROUS_FILE: Our signal is currently is that the file *could* be dangerous. At the ...
7 years, 2 months ago (2013-10-11 19:09:41 UTC) #5
felt
I have switched the if-statement to exclude DANGEROUS_FILE, but now I am not sure how ...
7 years, 2 months ago (2013-10-11 21:12:19 UTC) #6
asanka
On 2013/10/11 21:12:19, felt wrote: > I have switched the if-statement to exclude DANGEROUS_FILE, but ...
7 years, 2 months ago (2013-10-11 22:18:30 UTC) #7
felt
On 2013/10/11 22:18:30, asanka wrote: > On 2013/10/11 21:12:19, felt wrote: > > I have ...
7 years, 2 months ago (2013-10-11 23:40:54 UTC) #8
felt
https://codereview.chromium.org/26938003/diff/16001/chrome/browser/ui/browser_close_browsertest.cc File chrome/browser/ui/browser_close_browsertest.cc (right): https://codereview.chromium.org/26938003/diff/16001/chrome/browser/ui/browser_close_browsertest.cc#newcode282 chrome/browser/ui/browser_close_browsertest.cc:282: << ": " << check_case.DebugString(); On 2013/10/11 19:09:42, asanka ...
7 years, 2 months ago (2013-10-11 23:41:09 UTC) #9
felt
thakis@, benjhayden@, pkasting@, and joi@ could you please review the following files? thakis - chrome/browser/app_controller_mac.mm, ...
7 years, 2 months ago (2013-10-15 17:53:56 UTC) #10
Nico
my two files lgtm
7 years, 2 months ago (2013-10-15 18:22:18 UTC) #11
Jói
LGTM for content/public with a nit. https://codereview.chromium.org/26938003/diff/49001/content/public/browser/download_item.h File content/public/browser/download_item.h (right): https://codereview.chromium.org/26938003/diff/49001/content/public/browser/download_item.h#newcode325 content/public/browser/download_item.h:325: virtual std::string DebugString(bool ...
7 years, 2 months ago (2013-10-15 19:00:44 UTC) #12
benjhayden
downloads_api_browsertest.cc lgtm
7 years, 2 months ago (2013-10-15 19:03:02 UTC) #13
Peter Kasting
c/b/ui LGTM, but this is a very risky change. I left some comments on the ...
7 years, 2 months ago (2013-10-15 19:10:27 UTC) #14
felt
On 2013/10/15 19:10:27, Peter Kasting wrote: > c/b/ui LGTM, but this is a very risky ...
7 years, 2 months ago (2013-10-15 20:03:52 UTC) #15
asanka
Apologies for the delay. https://codereview.chromium.org/26938003/diff/49001/chrome/browser/lifetime/browser_close_manager_browsertest.cc File chrome/browser/lifetime/browser_close_manager_browsertest.cc (right): https://codereview.chromium.org/26938003/diff/49001/chrome/browser/lifetime/browser_close_manager_browsertest.cc#newcode654 chrome/browser/lifetime/browser_close_manager_browsertest.cc:654: content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL); It would be great ...
7 years, 2 months ago (2013-10-15 21:39:07 UTC) #16
felt
Asanka, I created a TestDownloadManagerDelegate. https://codereview.chromium.org/26938003/diff/49001/chrome/browser/ui/browser_close_browsertest.cc File chrome/browser/ui/browser_close_browsertest.cc (right): https://codereview.chromium.org/26938003/diff/49001/chrome/browser/ui/browser_close_browsertest.cc#newcode259 chrome/browser/ui/browser_close_browsertest.cc:259: << ": " << ...
7 years, 2 months ago (2013-10-18 01:50:53 UTC) #17
felt
Hi Asanka, I can't figure out why the browser test fails on CrOS. It looks ...
7 years, 2 months ago (2013-10-18 23:24:48 UTC) #18
Nico
On Fri, Oct 18, 2013 at 4:24 PM, <felt@chromium.org> wrote: > Hi Asanka, > > ...
7 years, 2 months ago (2013-10-18 23:27:40 UTC) #19
felt
On 2013/10/18 23:27:40, Nico wrote: > On Fri, Oct 18, 2013 at 4:24 PM, <mailto:felt@chromium.org> ...
7 years, 2 months ago (2013-10-18 23:45:34 UTC) #20
Nico
On Fri, Oct 18, 2013 at 4:45 PM, <felt@chromium.org> wrote: > On 2013/10/18 23:27:40, Nico ...
7 years, 2 months ago (2013-10-18 23:53:22 UTC) #21
asanka
https://codereview.chromium.org/26938003/diff/323001/chrome/browser/lifetime/browser_close_manager_browsertest.cc File chrome/browser/lifetime/browser_close_manager_browsertest.cc (right): https://codereview.chromium.org/26938003/diff/323001/chrome/browser/lifetime/browser_close_manager_browsertest.cc#newcode169 chrome/browser/lifetime/browser_close_manager_browsertest.cc:169: : ChromeDownloadManagerDelegate(profile) { On ChromeOS, the DriveIntegrationService kicks in ...
7 years, 2 months ago (2013-10-19 00:42:30 UTC) #22
felt
On 2013/10/18 23:53:22, Nico wrote: > On Fri, Oct 18, 2013 at 4:45 PM, <mailto:felt@chromium.org> ...
7 years, 2 months ago (2013-10-19 02:50:08 UTC) #23
felt
https://codereview.chromium.org/26938003/diff/323001/chrome/browser/lifetime/browser_close_manager_browsertest.cc File chrome/browser/lifetime/browser_close_manager_browsertest.cc (right): https://codereview.chromium.org/26938003/diff/323001/chrome/browser/lifetime/browser_close_manager_browsertest.cc#newcode169 chrome/browser/lifetime/browser_close_manager_browsertest.cc:169: : ChromeDownloadManagerDelegate(profile) { On 2013/10/19 00:42:31, asanka wrote: > ...
7 years, 2 months ago (2013-10-19 02:51:49 UTC) #24
asanka
LGTM
7 years, 2 months ago (2013-10-20 04:32:27 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/felt@chromium.org/26938003/313001
7 years, 2 months ago (2013-10-20 17:14:16 UTC) #26
commit-bot: I haz the power
Retried try job too often on win7_aura for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=90876
7 years, 2 months ago (2013-10-21 03:10:37 UTC) #27
felt
7 years, 2 months ago (2013-10-21 12:10:47 UTC) #28
Message was sent while issue was closed.
Committed patchset #17 manually as r229784 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698