[webkit-reviews] review granted: [Bug 137736] Use std::unique_ptr for CachedResource : [Attachment 239858] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 15 09:38:25 PDT 2014


Darin Adler <darin at apple.com> has granted Gyuyoung Kim
<gyuyoung.kim at webkit.org>'s request for review:
Bug 137736: Use std::unique_ptr for CachedResource
https://bugs.webkit.org/show_bug.cgi?id=137736

Attachment 239858: Patch
https://bugs.webkit.org/attachment.cgi?id=239858&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=239858&action=review


OK to do this, but please use make_unique.

> Source/WebCore/loader/cache/CachedResource.cpp:517
> +    std::unique_ptr<CachedResourceCallback> callback =
m_clientsAwaitingCallback.take(client);

I’d suggest using auto here instead of writing out the type.

> Source/WebCore/loader/cache/CachedResource.h:271
> +	   static std::unique_ptr<CachedResourceCallback>
schedule(CachedResource* resource, CachedResourceClient* client) { return
std::unique_ptr<CachedResourceCallback>(new CachedResourceCallback(resource,
client)); }

This should use make_unique, not an explicit constructor and new.


More information about the webkit-reviews mailing list