<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] Update cookie manager API to properly work with ephemeral sessions"
href="https://bugs.webkit.org/show_bug.cgi?id=168230#c5">Comment # 5</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] Update cookie manager API to properly work with ephemeral sessions"
href="https://bugs.webkit.org/show_bug.cgi?id=168230">bug 168230</a>
from <span class="vcard"><a class="email" href="mailto:cgarcia@igalia.com" title="Carlos Garcia Campos <cgarcia@igalia.com>"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=168230#c3">comment #3</a>)
<span class="quote">> Comment on <span class=""><a href="attachment.cgi?id=301345&action=diff" name="attach_301345" title="Patch">attachment 301345</a> <a href="attachment.cgi?id=301345&action=edit" title="Patch">[details]</a></span>
> Patch
>
> View in context:
> <a href="https://bugs.webkit.org/attachment.cgi?id=301345&action=review">https://bugs.webkit.org/attachment.cgi?id=301345&action=review</a>
>
> >> Source/WebCore/platform/network/soup/CookieJarSoup.cpp:217
> >> + deleteAllCookies(session);
> >
> > Are you planning to fix this soon? I don't think we should proceed with these API changes if the API does not work properly. At least add a runtime warning using g_warning().
>
> (Sad OK if you add the g_warning().)
>
> > Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp:115
> > + if (manager->priv->dataManager) {
> > + g_object_remove_weak_pointer(G_OBJECT(manager->priv->dataManager), reinterpret_cast<void**>(&manager->priv->dataManager));
> > +
> > + auto sessionID = webkitWebsiteDataManagerGetDataStore(manager->priv->dataManager).websiteDataStore().sessionID();
> > + for (auto* processPool : webkitWebsiteDataManagerGetProcessPools(manager->priv->dataManager))
> > + processPool->supplement<WebCookieManagerProxy>()->stopObservingCookieChanges(sessionID);
> > +
> > + manager->priv->dataManager = nullptr;
> > + }
>
> Actually, I wonder if we should do this in ~_WebKitCookieManagerPrivate()
> instead of dispose. Because the object should technically be left in valid
> state after dispose, but all of the functions are going to hit criticals if
> priv->dataManager is null. Since we're not keeping a strong reference to it,
> it can't be involved in a reference cycle, so it should be safer to do in
> the destructor instead of dispose.</span >
I want to stop observing cookie changes asap, and I need to nullify the pointer to ensure it doesn't happen twice.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>