[Webkit-unassigned] [Bug 82082] [SOUP] Implement missing methods in CookieJarSoup

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 26 09:32:08 PDT 2012


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





--- Comment #9 from Martin Robinson <mrobinson at webkit.org>  2012-03-26 09:32:08 PST ---
(In reply to comment #8)

> I don't get what you mean, GOwnPtr always frees the pointer as a side-effect for me. We usually do something like
> 
> GOwnPtr<char> foo(g_strdup("Foo"));
> use_foo (bar, foo.get());
> 
> and that's supposed to be fine. 
> 
> This is the same, we have a method that returns a new allocated list, which transfers the full list, container and contents, so you are expected to free it, the same way g_strdup() returns a new allocated string that you should free it when done. 

Note the "Own" in GOwnPtr. The way it's typically designed to work is that OwnPtr immediately contains a raw pointer after allocation. It owns it. The WTF version even has PassOwnPtr, which tries to enforce this more strongly. 

In this case GOwnPtr doesn't "own" the pointers in the GSList. Conceptually speaking, they are owned by the GSList itself. soup_cookies_free frees both the list and the individual cookies, because in a sense they are one complete unit of data. In your patch GOwnPtr is simply used as a mechanism to free the cookies that are owned by the list.

This is why it was confusing to me.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list