Bug 145384

Summary: Introduce WTF::createRef<T>(Args&&...)
Product: WebKit Reporter: Zan Dobersek <zan>
Component: New BugsAssignee: Zan Dobersek <zan>
Status: NEW    
Severity: Normal CC: andersca, benjamin, cmarcelo, commit-queue, esprehn+autocc, Hironori.Fujii, kangil.han, zan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=238392
Attachments:
Description Flags
Test patch
none
Test patch
none
Test patch
none
Patch
none
Patch
none
Patch none

Zan Dobersek
Reported 2015-05-26 13:22:46 PDT
Introduce WTF::createRef<T>(Args&&...)
Attachments
Test patch (3.13 KB, patch)
2015-05-26 13:25 PDT, Zan Dobersek
no flags
Test patch (6.67 KB, patch)
2015-05-28 09:14 PDT, Zan Dobersek
no flags
Test patch (32.89 KB, patch)
2015-05-29 03:48 PDT, Zan Dobersek
no flags
Patch (33.05 KB, patch)
2015-06-04 11:20 PDT, Zan Dobersek
no flags
Patch (37.11 KB, patch)
2015-06-06 07:26 PDT, Zan Dobersek
no flags
Patch (3.91 KB, patch)
2015-06-09 11:46 PDT, Zan Dobersek
no flags
Zan Dobersek
Comment 1 2015-05-26 13:25:53 PDT
Created attachment 253727 [details] Test patch Checking how the EWSs handle it (specifically the friend template declaration).
Zan Dobersek
Comment 2 2015-05-28 09:14:15 PDT
Created attachment 253847 [details] Test patch Further iteration.
Zan Dobersek
Comment 3 2015-05-29 03:48:47 PDT
Created attachment 253900 [details] Test patch Another iteration, testing out modifying AsyncRequestImpl creation.
WebKit Commit Bot
Comment 4 2015-05-29 03:51:15 PDT
Attachment 253900 [details] did not pass style-queue: ERROR: Source/WebKit2/Shared/AsyncRequest.h:77: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 1 in 11 files If any of these errors are false positives, please file a bug against check-webkit-style.
Zan Dobersek
Comment 5 2015-06-04 11:20:18 PDT
Created attachment 254279 [details] Patch Another run through the EWS.
WebKit Commit Bot
Comment 6 2015-06-04 11:23:01 PDT
Attachment 254279 [details] did not pass style-queue: ERROR: Source/WebKit2/Shared/AsyncRequest.h:77: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 1 in 11 files If any of these errors are false positives, please file a bug against check-webkit-style.
Zan Dobersek
Comment 7 2015-06-06 07:26:38 PDT
Created attachment 254413 [details] Patch More of an RFC about the idea, approach and namings.
WebKit Commit Bot
Comment 8 2015-06-06 07:27:50 PDT
Attachment 254413 [details] did not pass style-queue: ERROR: Source/WebKit2/Shared/AsyncRequest.h:77: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 1 in 12 files If any of these errors are false positives, please file a bug against check-webkit-style.
Anders Carlsson
Comment 9 2015-06-06 09:27:04 PDT
Comment on attachment 254413 [details] Patch This is an interesting idea, but we _could_ just put it as a static member function on RefCounted directly - that way the friend declaration would be less awkward.
Zan Dobersek
Comment 10 2015-06-09 09:59:57 PDT
(In reply to comment #9) > Comment on attachment 254413 [details] > Patch > > This is an interesting idea, but we _could_ just put it as a static member > function on RefCounted directly - that way the friend declaration would be > less awkward. Could you please elaborate on how the friend declaration would look? I ended up with a pretty similar declaration. I chose createRef so that the name indicates the type of the returned value, much like std::make_unique<>() indicates that std::unique_ptr<> is returned.
Anders Carlsson
Comment 11 2015-06-09 10:04:57 PDT
(In reply to comment #10) > > Could you please elaborate on how the friend declaration would look? I ended > up with a pretty similar declaration. > friend class RefCounted<MyClass>;
Zan Dobersek
Comment 12 2015-06-09 11:46:38 PDT
Created attachment 254583 [details] Patch Adds RefCounted<T>::create(), friends just RefCounted<T>.
Note You need to log in before you can comment on or make changes to this bug.