Bug 234411 - Add custom copy() method for Ref<T> to CrossThreadCopier
Summary: Add custom copy() method for Ref<T> to CrossThreadCopier
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sihui Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-12-16 17:24 PST by Sihui Liu
Modified: 2021-12-17 14:55 PST (History)
7 users (show)

See Also:


Attachments
Patch (12.46 KB, patch)
2021-12-16 20:49 PST, Sihui Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sihui Liu 2021-12-16 17:24:56 PST
...
Comment 1 Sihui Liu 2021-12-16 20:49:07 PST
Created attachment 447417 [details]
Patch
Comment 2 EWS 2021-12-17 14:26:27 PST
Committed r287207 (245374@main): <https://commits.webkit.org/245374@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 447417 [details].
Comment 3 Radar WebKit Bug Importer 2021-12-17 14:27:19 PST
<rdar://problem/86650725>
Comment 4 Darin Adler 2021-12-17 14:55:38 PST
Comment on attachment 447417 [details]
Patch

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

> Source/WTF/wtf/CrossThreadCopier.h:58
> +        typedef T Type;

Reminds me that in newer code we’d love to use "using" rather than typedef.

> Source/WTF/wtf/CrossThreadCopier.h:107
> +    typedef Ref<T> Type;

Like here too.

> Source/WTF/wtf/CrossThreadCopier.h:111
> +    static Type copy(const Type& ref)
> +    {
> +        return ref;
> +    }

I probably would write these as one-liners.