[Webkit-unassigned] [Bug 174942] [Curl] Use SQLite database in cookie jar implementation for Curl port

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 18 13:00:50 PST 2018


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

--- Comment #3 from Christopher Reid <christopher.reid at am.sony.com> ---
(In reply to Alex Christensen from comment #2)
> Comment on attachment 331552 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=331552&action=review
> 
> I feel like this patch has a lot of parsers.  Are there not existing parsers
> for these things?

I wasn't able to find any parsers for cookie strings within WebCore for other network layers. They all seem to be using a library for parsing.
CookieJarSoup uses soup_cookie_parse
CookieJarCF uses CFHTTPCookieCreateWithResponseHeaderFields
CookieJarMac uses NSHTTPCookie's cookiesWithResponseHeaderFields

getNetscapeCookieFormat in CookieJarCurl does some similar parsing but it can't be used directly since it's just returning a string in a different format.
I can pull out that parsing code and share it with the cookie jar if that's preferred.

> > Source/WebCore/ChangeLog:3
> > +        [Curl] Use SQLite database in cookie jar implementation for Curl port
> 
> Cool!
> 
> > Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp:89
> > +    CookieJarDB* cookieJarDB = CookieJarDB::getInstance();
> 
> This should be implemented by NetworkStorageSession instead of having a
> global singleton.
> 

I'll look into using that.

> > Source/WebCore/platform/network/curl/CookieJarDB.cpp:76
> > +CookieJarDB* CookieJarDB::getInstance()
> 
> This could return a reference.
> 

Will do.

> > Source/WebCore/platform/network/curl/CookieJarDB.cpp:80
> > +        CookieJarDB::s_instance = new CookieJarDB();
> 
> This should use smart pointers or NeverDestroyed to avoid explicit
> new/delete calls.
> 

Will do.

> > Source/WebCore/platform/network/curl/CookieJarDB.cpp:84
> > +void CookieJarDB::releaseInstance()
> 
> This is never called.
> 

I'll take that out.

> > Source/WebCore/platform/network/curl/CookieJarDB.cpp:191
> > +void CookieJarDB::detectDatabaseCorruption()
> 
> Does this really detect anything?
> 

flagDatabaseCorruption seems like a more suitable name.

> > Source/WebCore/platform/network/curl/CookieUtil.cpp:82
> > +static bool parseExpires(const char* expires, time_t& time)
> 
> This could return std::optional<time_t>

Will do.


Thanks for the feedback.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180118/aaeb6432/attachment.html>


More information about the webkit-unassigned mailing list