[Webkit-unassigned] [Bug 143872] [SOUP] Add initial implementation of NetworkProcess disk cache

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 26 02:13:25 PDT 2015


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

--- Comment #24 from Carlos Garcia Campos <cgarcia at igalia.com> ---
(In reply to comment #23)
> (In reply to comment #22)
> > Comment on attachment 251553 [details]
> > Use fast malloc/free in IOChannel too
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=251553&action=review
> > 
> > > Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:201
> > > +    WriteAsyncData* asyncData = new WriteAsyncData { this, data.soupBuffer(), completionHandler };
> > 
> > It would be nicer and safer to use std::unique_ptr instead of explicit
> > new/delete for memory management.
> > 
> > auto asyncData = std::make_unique<WriteAsyncData>(...)
> 
> I didn't do this because the pointer is passed as user data of a C callback.

Well, I can adopt the pointer at the beginning of the clabback and release it before calling the read/write method method again. It's still tricky, because we can't use the wrapped pointer in the read/write call, so we need to save the buffer to a local variable and then release the unique_ptr. I'll update the patch.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150426/843a8ad6/attachment-0001.html>


More information about the webkit-unassigned mailing list