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

Issue 1675533002: Make the download request limiter listen to content settings changes. (Closed)

Created:
4 years, 10 months ago by dominickn
Modified:
4 years, 10 months ago
Reviewers:
asanka
CC:
chromium-reviews, asanka, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make the download request limiter listen to content settings changes. The download request limiter persists the automatic downloads content setting per origin. This indicates which sites users have allowed to trigger multiple automatic downloads. However, the limiter does not respect changes made to the content setting via the OIB or content settings pages. This means that the user can change the content settings (e.g. accidentally allowed the permission, visit OIB to revoke permission), but the limiter will not change its internal state to match the new setting. In this case, the limiter will continue to allow all downloads, even after reloading the page. This CL fixes the bug by making the limiter listen to the NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED notification, updating its internal state when the automatic downloads setting has been changed. Unit tests are also added to ensure the correct behaviour. BUG=584146 TEST=Changing automatic downloads permissions in the OIB or in content settings will be applied on page reload. Committed: https://crrev.com/8aea480299a0b812aa3705d9a7c84d811ed075ef Cr-Commit-Position: refs/heads/master@{#375396}

Patch Set 1 #

Patch Set 2 : Rebase #

Total comments: 6

Patch Set 3 : Address reviewer comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -10 lines) Patch
M chrome/browser/download/download_request_limiter.cc View 1 2 4 chunks +57 lines, -8 lines 0 comments Download
M chrome/browser/download/download_request_limiter_unittest.cc View 1 2 5 chunks +76 lines, -2 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 13 (6 generated)
dominickn
PTAL, thanks!
4 years, 10 months ago (2016-02-05 11:04:47 UTC) #3
asanka
https://codereview.chromium.org/1675533002/diff/20001/chrome/browser/download/download_request_limiter.cc File chrome/browser/download/download_request_limiter.cc (right): https://codereview.chromium.org/1675533002/diff/20001/chrome/browser/download/download_request_limiter.cc#newcode227 chrome/browser/download/download_request_limiter.cc:227: if (setting == CONTENT_SETTING_ALLOW) { Nit: use a switch ...
4 years, 10 months ago (2016-02-08 15:02:14 UTC) #4
dominickn
PTAL, thanks! https://codereview.chromium.org/1675533002/diff/20001/chrome/browser/download/download_request_limiter.cc File chrome/browser/download/download_request_limiter.cc (right): https://codereview.chromium.org/1675533002/diff/20001/chrome/browser/download/download_request_limiter.cc#newcode227 chrome/browser/download/download_request_limiter.cc:227: if (setting == CONTENT_SETTING_ALLOW) { On 2016/02/08 ...
4 years, 10 months ago (2016-02-11 01:25:53 UTC) #5
asanka
lgtm. thanks!
4 years, 10 months ago (2016-02-12 16:56:51 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1675533002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1675533002/40001
4 years, 10 months ago (2016-02-14 23:31:35 UTC) #9
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 10 months ago (2016-02-15 00:20:23 UTC) #11
commit-bot: I haz the power
4 years, 10 months ago (2016-02-16 22:48:30 UTC) #13
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/8aea480299a0b812aa3705d9a7c84d811ed075ef
Cr-Commit-Position: refs/heads/master@{#375396}

Powered by Google App Engine
This is Rietveld 408576698