Skip to content
Permalink
Browse files
REGRESSION(r294381): [ Debug ] TestWebKitAPI.WebKit.CookieObserverCra…
…sh is a constant crash

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

Reviewed by Alex Christensen.

The crash is an assertion failure. The assertion ensures that WebCookieManagerProxy has no cookies observer when it gets
destroyed. The assertion was valid when it was added, since WKHTTPCookieStore does not outlive WebKit::WebsiteDataStore
(r219550), and observers will be removed when WKHTTPCookieStore is deallocated. Since r279074, WKHTTPCookieStore can
outlive WebKit::WebsiteDataStore -- it holds a weak reference to WebKit::WebsiteDataStore instead of a strong reference,
so the assertion does not hold.

* Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::~WebCookieManagerProxy):

Canonical link: https://commits.webkit.org/250992@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294860 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
szewai committed May 26, 2022
1 parent 429b498 commit 3ba1f41903458b83023c18a70f308bba8d950ae2
Showing 1 changed file with 2 additions and 1 deletion.
@@ -49,7 +49,8 @@ WebCookieManagerProxy::~WebCookieManagerProxy()
{
if (m_networkProcess)
m_networkProcess->removeMessageReceiver(Messages::WebCookieManagerProxy::messageReceiverName());
ASSERT(m_cookieObservers.isEmpty());
if (!m_cookieObservers.isEmpty())
RELEASE_LOG(Storage, "WebCookieManagerProxy::~WebCookieManagerProxy %u cookie observers will be invalidated", m_cookieObservers.size());
}

void WebCookieManagerProxy::getHostnamesWithCookies(PAL::SessionID sessionID, CompletionHandler<void(Vector<String>&&)>&& callbackFunction)

0 comments on commit 3ba1f41

Please sign in to comment.