Skip to content
  • dominickn's avatar
    Check embargo status in PlatformNotificationServiceImpl::CheckPermissionOnIOThread · 66e276cf
    dominickn authored
    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}
    66e276cf