Summary: | iOS 11.3 delays creation of WKWebsiteDataStore and queues setCookie completion handler | ||
---|---|---|---|
Product: | WebKit | Reporter: | Harry Shamansky <hshamansky> |
Component: | WebKit API | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW --- | ||
Severity: | Normal | CC: | beidson, cdumez, sihui_liu, thorton, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Other | ||
Hardware: | iPhone / iPad | ||
OS: | iOS 11 |
Description
Harry Shamansky
2018-05-09 12:02:34 PDT
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? |