Bug 110103 - [Soup] Free cookies explicitly in loops instead of using GOwnPtr
Summary: [Soup] Free cookies explicitly in loops instead of using GOwnPtr
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-18 04:37 PST by Chris Dumez
Modified: 2013-02-18 11:03 PST (History)
7 users (show)

See Also:


Attachments
Patch (2.51 KB, patch)
2013-02-18 04:44 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (3.49 KB, patch)
2013-02-18 09:35 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2013-02-18 04:37:28 PST
We sometimes use GOwnPtr to free the cookies, and sometimes free them manually using soup_cookie_free(). We should make this more consistent and use GOwnPtr as much as possible and this is the preferred pattern.
Comment 1 Chris Dumez 2013-02-18 04:44:03 PST
Created attachment 188851 [details]
Patch
Comment 2 Carlos Garcia Campos 2013-02-18 05:14:30 PST
I agree with this change, but note that Martin was opposed to it, see the discussion in bug https://bugs.webkit.org/show_bug.cgi?id=82082.
Comment 3 Chris Dumez 2013-02-18 05:18:22 PST
(In reply to comment #2)
> I agree with this change, but note that Martin was opposed to it, see the discussion in bug https://bugs.webkit.org/show_bug.cgi?id=82082.

Ok, clearing commit flag for now then. I assumed this was fine because GOwnPtr is already used this way in getRawCookies() and deleteCookie().

We should be consistent (either way). We have 2 functions uses GOwnPtr and 2 using soup_cookie_free(). I'll wait for Martin to comment on this.
Comment 4 Chris Dumez 2013-02-18 09:27:53 PST
Comment on attachment 188851 [details]
Patch

Based on IRC discussion with Martin Robinson, I'll upload a patch harmonizing the other way around (freeing explicitly).
Comment 5 Chris Dumez 2013-02-18 09:35:02 PST
Created attachment 188908 [details]
Patch
Comment 6 WebKit Review Bot 2013-02-18 11:03:04 PST
Comment on attachment 188908 [details]
Patch

Clearing flags on attachment: 188908

Committed r143243: <http://trac.webkit.org/changeset/143243>
Comment 7 WebKit Review Bot 2013-02-18 11:03:09 PST
All reviewed patches have been landed.  Closing bug.