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

Issue 2926773002: Check embargo status in PlatformNotificationServiceImpl::CheckPermissionOnIOThread (Closed)

Created:
3 years, 6 months ago by dominickn
Modified:
3 years, 6 months ago
CC:
chromium-reviews, Peter Beverloo, mlamouri+watch-permissions_chromium.org, mlamouri+watch-notifications_chromium.org, awdf+watch_chromium.org, raymes+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Check embargo status in PlatformNotificationServiceImpl::CheckPermissionOnIOThread window.Notification.permission directly checks the HostContentSettingsMap for notification permission. This means that if the permission is embargoed, it will incorrectly return "default" instead of "denied". This CL refactors PermissionDecisionAutoBlocker::GetEmbargoResult to be a static method that can be called with a HostContentSettingsMap argument. This allows the PlatformNotificationServiceImpl (which is running on the IO thread) to check the embargo status of the notification permission and return the correct value. The long-term fix here is that PermissionManager::GetPermissionStatus must be made thread safe so that there is one and only one way to correctly query permission status from any thread. BUG=730273 Review-Url: https://codereview.chromium.org/2926773002 Cr-Commit-Position: refs/heads/master@{#477856} Committed: https://chromium.googlesource.com/chromium/src/+/66e276cfca435df9c8c5d42580a6a88406b311fe

Patch Set 1 #

Total comments: 4

Patch Set 2 : Nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+66 lines, -33 lines) Patch
M chrome/browser/notifications/platform_notification_service_impl.cc View 1 3 chunks +14 lines, -1 line 0 comments Download
M chrome/browser/permissions/permission_decision_auto_blocker.h View 1 2 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/permissions/permission_decision_auto_blocker.cc View 1 3 chunks +40 lines, -32 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 21 (14 generated)
dominickn
raymes: PTAL at permissions/ miguelg: PTAL at notifications/ This is something that should be merged ...
3 years, 6 months ago (2017-06-07 01:54:06 UTC) #4
raymes
lgtm thanks Dom. It would be good to add a regression test for this but ...
3 years, 6 months ago (2017-06-07 02:57:54 UTC) #8
Miguel Garcia
https://cs.chromium.org/chromium/src/chrome/browser/notifications/notification_interactive_uitest.cc?q=file:notification+uitest+package:%5Echromium$&dr=C&l=23 is a good e2e test where this could be tested. https://codereview.chromium.org/2926773002/diff/1/chrome/browser/notifications/platform_notification_service_impl.cc File chrome/browser/notifications/platform_notification_service_impl.cc (right): ...
3 years, 6 months ago (2017-06-07 14:15:38 UTC) #9
Miguel Garcia
lgtm
3 years, 6 months ago (2017-06-07 14:15:47 UTC) #10
dominickn
Thanks! I've uploaded an end-to-end test for Notification.permission at https://codereview.chromium.org/2925203003. I split it out in ...
3 years, 6 months ago (2017-06-08 01:03:04 UTC) #13
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/2926773002/20001
3 years, 6 months ago (2017-06-08 01:52:20 UTC) #18
commit-bot: I haz the power
3 years, 6 months ago (2017-06-08 01:57:07 UTC) #21
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/66e276cfca435df9c8c5d42580a6...

Powered by Google App Engine
This is Rietveld 408576698