Bug 82598

Summary: [GTK] Add WebKitCookieManager::changed signal to WebKit2 GTK+ API
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: gustavo, svillar
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Bug Depends on: 82441    
Bug Blocks: 83016    
Attachments:
Description Flags
Patch
none
Updated patch pnormand: review+

Description Carlos Garcia Campos 2012-03-29 04:54:29 PDT
To notify when cookies have changed.
Comment 1 Carlos Garcia Campos 2012-03-29 05:02:22 PDT
Created attachment 134552 [details]
Patch
Comment 2 Sergio Villar Senin 2012-03-29 05:06:58 PDT
Comment on attachment 134552 [details]
Patch

looks great to me
Comment 3 Martin Robinson 2012-03-29 08:44:51 PDT
Comment on attachment 134552 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=134552&action=review

Seems good to me, but I have the following doubt:

> Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp:58
> +    WKCookieManagerStartObservingCookieChanges(priv->wkCookieManager.get());

Did you mean to write WKCookieManagerStopObservingCookieChanges here?
Comment 4 Carlos Garcia Campos 2012-03-29 08:47:55 PDT
Comment on attachment 134552 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=134552&action=review

>> Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp:58
>> +    WKCookieManagerStartObservingCookieChanges(priv->wkCookieManager.get());
> 
> Did you mean to write WKCookieManagerStopObservingCookieChanges here?

Indeed, copy paste error, good catch! :-P
Comment 5 Carlos Garcia Campos 2012-04-03 01:50:45 PDT
Created attachment 135292 [details]
Updated patch

Stop observing changes in finalize.
Comment 6 Philippe Normand 2012-04-24 06:46:11 PDT
Comment on attachment 135292 [details]
Updated patch

View in context: https://bugs.webkit.org/attachment.cgi?id=135292&action=review

LGTM

> Source/WebCore/platform/network/soup/CookieStorageSoup.cpp:36
> +void setCookieStoragePrivateBrowsingEnabled(bool enabled)
> +{
> +    notImplemented();

Would it make sense to start/stop observing cookies there? depending on the enabled value.
I can't find this function used in WebKit2 btw, is it part of some DerivedSources or was it removed from the other ports?
Comment 7 Carlos Garcia Campos 2012-04-24 08:15:05 PDT
(In reply to comment #6)
> (From update of attachment 135292 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=135292&action=review
> 
> LGTM
> 
> > Source/WebCore/platform/network/soup/CookieStorageSoup.cpp:36
> > +void setCookieStoragePrivateBrowsingEnabled(bool enabled)
> > +{
> > +    notImplemented();
> 
> Would it make sense to start/stop observing cookies there? depending on the enabled value.
> I can't find this function used in WebKit2 btw, is it part of some DerivedSources or was it removed from the other ports?

This function is declared in CookieStorage.h so we need to provide an implementation even if it's empty. When private browsing is enabled, the cookie storage used for private browsing will be observed for changes, so I don't think we need to do anything here.
Comment 8 Carlos Garcia Campos 2012-04-24 08:19:03 PDT
Committed r115057: <http://trac.webkit.org/changeset/115057>