Bug 79494 - requestPermission callback not invoked if the WebProcess doesn't have to ask the UI Process about the permission level
Summary: requestPermission callback not invoked if the WebProcess doesn't have to ask ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jessie Berlin
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-02-24 08:22 PST by Jessie Berlin
Modified: 2012-02-24 10:52 PST (History)
3 users (show)

See Also:


Attachments
Patch (1.77 KB, patch)
2012-02-24 08:27 PST, Jessie Berlin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jessie Berlin 2012-02-24 08:22:02 PST
If a site already has had permission granted to them to post notifications, and the Web Process already knows about this permission, if the site again calls requestPermission, the callback is never invoked.

This is because of the following code in NotificationPermissionRequestManager.cpp:

void NotificationPermissionRequestManager::startRequest(SecurityOrigin* origin, PassRefPtr<VoidCallback> callback)
{
#if ENABLE(NOTIFICATIONS)
    if (permissionLevel(origin) != NotificationPresenter::PermissionNotAllowed)
        return;

    uint64_t requestID = generateRequestID();
    m_originToIDMap.set(origin, requestID);
    m_idToOriginMap.set(requestID, origin);
    m_idToCallbackMap.set(requestID, callback);
    m_page->send(Messages::WebPageProxy::RequestNotificationPermission(requestID, origin->toString()));
#else
    UNUSED_PARAM(origin);
    UNUSED_PARAM(callback);
#endif
}

That first if statement should invoke the callback.

<rdar://problem/10923498>
Comment 1 Jessie Berlin 2012-02-24 08:27:43 PST
Created attachment 128739 [details]
Patch
Comment 2 Jessie Berlin 2012-02-24 10:52:24 PST
Comment on attachment 128739 [details]
Patch

Fixed in http://trac.webkit.org/changeset/108822