Bug 237142 - Regression(r273929) FrameState no longer gets a move constructor
Summary: Regression(r273929) FrameState no longer gets a move constructor
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-02-24 09:11 PST by Chris Dumez
Modified: 2022-02-24 11:49 PST (History)
6 users (show)

See Also:


Attachments
Patch (1.64 KB, patch)
2022-02-24 09:12 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (1.61 KB, patch)
2022-02-24 09:23 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2022-02-24 09:11:46 PST
FrameState no longer gets an implicit move constructor since r273929 because a custom destructor was added.
Comment 1 Chris Dumez 2022-02-24 09:12:44 PST
Created attachment 453106 [details]
Patch
Comment 2 Darin Adler 2022-02-24 09:16:03 PST
Comment on attachment 453106 [details]
Patch

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

> Source/WebKit/Shared/SessionState.h:93
> +    FrameState(const FrameState&) = default;
> +    FrameState(FrameState&&) = default;
> +    FrameState& operator=(const FrameState&) = default;
> +    FrameState& operator=(FrameState&&) = default;

I’d think we’d want the "main run loop" assertion on these other constructors too, maybe even the assignment operators, but sadly could not take advantage of the defaults then. Valuable to group these with the constructor/destructor pair, since we should delete them all at the same time.
Comment 3 Chris Dumez 2022-02-24 09:23:32 PST
Created attachment 453108 [details]
Patch
Comment 4 Chris Dumez 2022-02-24 09:30:16 PST
(In reply to Darin Adler from comment #2)
> Comment on attachment 453106 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=453106&action=review
> 
> > Source/WebKit/Shared/SessionState.h:93
> > +    FrameState(const FrameState&) = default;
> > +    FrameState(FrameState&&) = default;
> > +    FrameState& operator=(const FrameState&) = default;
> > +    FrameState& operator=(FrameState&&) = default;
> 
> I’d think we’d want the "main run loop" assertion on these other
> constructors too, maybe even the assignment operators, but sadly could not
> take advantage of the defaults then. Valuable to group these with the
> constructor/destructor pair, since we should delete them all at the same
> time.

I did the grouping as suggested. I am not convinced it is worth writing these by hand just to be able to add the threading assertion though.
Comment 5 Darin Adler 2022-02-24 09:41:00 PST
I have no idea how important it is to get the threading assertion right so I don’t have much of an opinion; not sure what made us add that. But I do note that adding it to the default constructor and the destructor is an inconsistent choice since it affects *some* construction and *all* destruction. Oversights like that have been a problem for me before when hunting bugs.
Comment 6 EWS 2022-02-24 11:48:53 PST
Committed r290446 (247749@main): <https://commits.webkit.org/247749@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 453108 [details].
Comment 7 Radar WebKit Bug Importer 2022-02-24 11:49:45 PST
<rdar://problem/89431031>