Introduce WTF::createRef<T>(Args&&...)
Created attachment 253727 [details] Test patch Checking how the EWSs handle it (specifically the friend template declaration).
Created attachment 253847 [details] Test patch Further iteration.
Created attachment 253900 [details] Test patch Another iteration, testing out modifying AsyncRequestImpl creation.
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.
Created attachment 254279 [details] Patch Another run through the EWS.
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.
Created attachment 254413 [details] Patch More of an RFC about the idea, approach and namings.
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.
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.
(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.
(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>;
Created attachment 254583 [details] Patch Adds RefCounted<T>::create(), friends just RefCounted<T>.