Bug 233772

Summary: MessageChannel::port1() / port2() should return references instead of pointers
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, darin, eric.carlson, esprehn+autocc, ews-watchlist, glenn, jer.noble, kangil.han, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 230382    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Chris Dumez 2021-12-02 10:36:29 PST
MessageChannel::port1() / port2() should return references instead of pointers.
Comment 1 Chris Dumez 2021-12-02 10:38:17 PST
Created attachment 445738 [details]
Patch
Comment 2 Chris Dumez 2021-12-02 10:39:51 PST
Created attachment 445740 [details]
Patch
Comment 3 Chris Dumez 2021-12-02 10:43:09 PST
Created attachment 445742 [details]
Patch
Comment 4 Chris Dumez 2021-12-02 12:27:13 PST
Created attachment 445760 [details]
Patch
Comment 5 EWS 2021-12-02 14:22:56 PST
Committed r286453 (244795@main): <https://commits.webkit.org/244795@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 445760 [details].
Comment 6 Radar WebKit Bug Importer 2021-12-02 14:23:36 PST
<rdar://problem/85989068>
Comment 7 Darin Adler 2021-12-02 14:42:56 PST
Comment on attachment 445760 [details]
Patch

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

> Source/WebCore/dom/MessageChannel.h:43
> +    MessagePort& port1() const { return m_ports.first.get(); }
> +    MessagePort& port2() const { return m_ports.second.get(); }

I think the get() calls here are optional. Probably compiles and works without them.
Comment 8 Chris Dumez 2021-12-02 15:05:33 PST
(In reply to Darin Adler from comment #7)
> Comment on attachment 445760 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=445760&action=review
> 
> > Source/WebCore/dom/MessageChannel.h:43
> > +    MessagePort& port1() const { return m_ports.first.get(); }
> > +    MessagePort& port2() const { return m_ports.second.get(); }
> 
> I think the get() calls here are optional. Probably compiles and works
> without them.

Indeed, fixed it via <https://commits.webkit.org/r286456>. Thanks.