Bug 142995 - [WTF] Use adoptUniquePtr and leakUniquePtr until C++14 unique_ptr capture in Lambda becomes available
Summary: [WTF] Use adoptUniquePtr and leakUniquePtr until C++14 unique_ptr capture in ...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-23 17:43 PDT by Joonghun Park
Modified: 2019-05-03 06:56 PDT (History)
8 users (show)

See Also:


Attachments
Patch (4.80 KB, patch)
2015-03-23 17:53 PDT, Joonghun Park
no flags Details | Formatted Diff | Diff
Patch (5.00 KB, patch)
2015-03-24 00:46 PDT, Joonghun Park
bfulgham: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joonghun Park 2015-03-23 17:43:48 PDT
According to Mr.Adler's comment "It’s not nearly was easy to spot the explicit std::unique_ptr construction and see that it matches up with the release() call. Seems like we should make an adopt function for unique_ptr in WTF so this idiom is more readable.", add adoptUniquePtr and leakUniquePtr.
Comment 1 Joonghun Park 2015-03-23 17:53:23 PDT
Created attachment 249306 [details]
Patch
Comment 2 Gyuyoung Kim 2015-03-23 19:16:44 PDT
Comment on attachment 249306 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=249306&action=review

I would like to delegate this patch's review to Darin.

> Source/WTF/ChangeLog:8
> +        make an adopt function and leak function for unique_ptr so that the pair is more readable.

Add a new line.

> Source/WTF/wtf/StdLibExtras.h:401
> +namespace WTF {

"namespace WTF" was already defined in 120 line. Looks like unnecessary namespace definition if this templates are moved into it.
Comment 3 Joonghun Park 2015-03-24 00:46:33 PDT
Created attachment 249318 [details]
Patch
Comment 4 Brent Fulgham 2016-03-10 10:43:53 PST
I wonder if this patch is old enough (due to our neglect) that our C++14 support has made it obsolete?
Comment 5 Brent Fulgham 2016-03-14 11:47:54 PDT
Comment on attachment 249318 [details]
Patch

This patch is almost a year old, and doesn't apply cleanly. I'm also not sure it's needed anymore due to the updated compilers in use this year. Can you please confirm it is still needed and upload a new patch if you feel it is still required?