[Webkit-unassigned] [Bug 185483] iOS 11.3 delays creation of WKWebsiteDataStore and queues setCookie completion handler

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 25 12:27:50 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=185483

--- Comment #1 from Chris Dumez <cdumez at apple.com> ---
Would you be able to provide a minimal test app? Looking at our code, we always call the completion handler right away:
void HTTPCookieStore::setCookie(const WebCore::Cookie& cookie, Function<void ()>&& completionHandler)
{
    auto* pool = m_owningDataStore->processPoolForCookieStorageOperations();
    if (!pool) {
        // FIXME: pendingCookies used for defaultSession because session cookies cannot be propagated to Network Process with uiProcessCookieStorageIdentifier.
        if (m_owningDataStore->sessionID() == PAL::SessionID::defaultSessionID() && !cookie.session)
            WebCore::NetworkStorageSession::defaultStorageSession().setCookie(cookie);
        else
            m_owningDataStore->addPendingCookie(cookie);

        // Calls the completion handler right away if we do not have a pool yet.
        callOnMainThread([completionHandler = WTFMove(completionHandler)]() {
            completionHandler();
        });
        return;
    }

    // This sends an IPC to the network process (starting it if it is not running) and we call the completion handler when the network process has processed the IPC.
    auto* cookieManager = pool->supplement<WebKit::WebCookieManagerProxy>();
    cookieManager->setCookie(m_owningDataStore->sessionID(), cookie, [pool = WTFMove(pool), completionHandler = WTFMove(completionHandler)](CallbackBase::Error error) {
        completionHandler();
    });
}

The code you mention that appends cookies does not delay the call of the completion handler.

Also note that we've made fixes in iOS 12 beta, did you test it?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180725/f1b4a4e0/attachment.html>


More information about the webkit-unassigned mailing list